The perilous state of Wales’ public finances has translated into swingeing cuts to teaching and research funding