New query parser internals.

Instead of directly generating the QueryOps we generate an internal
intermediate format first that's trivially covertible into QueryOps.

This is to make it easier to experiment with alternative query
parsers and prepared statements. It's also prettier.

Also, introduce more error handling into the parser instead of just
dying.

The String function of the intermediate format actually has a
good hint for what a query format can be.
Unnecessary import.

I'm surprised that the normally pedantic compiler didn't complain.