Add Monitors to parsing, semantic checking, AST rewriting and compiling with the new planner

* Moved out semantic checking from the parser to the compiler
* Same for AST rewriting: Parser -> Compiler