Compiler complete and working

There is one giant ugly function I want to break apart...