Test cases go really fast now. Not entirely sure what I changed. Maybe the 'raiseVarCase' thing?
Working towards converting everything to the simply typed lambda calculus, and fundamentally restructuring the code.