Lots of TreeCompiler cleanup