Make CompilerTests work!

This included a little refactoring of the compiler.