move compiler stuff to compiler.js