Build SemanticQuery in CypherCompiler instead of Planner

Also moves semantic checking past rewriting. We need to discuss this though.