Finished the qi::parser for parsing queries.

Also finished an untested visitor for converting the ast to queries.
but this commit is large enough as it is and compiles.