Compiler base reworked to new less global compiler

New compiler base
@stijn22 @nvanson @slemmen 

Ready for review, not ready for test
Formatting comment: Keep same code standard: either set EVERYTHING to 1 line function implementations or set this to multi line.