Split out the global variables, added simplistic compiling