Refactoring to only use QueryBuilder right at the last moment.

The reason for this is that we can't get the sub-sections of a WHERE out cleanly, making our get operation on WHERE incomplete. Since S10 is all about completeness, this isn't acceptable.
where() and orWhere() fully implemented in Query.

This includes fancy grouped sub-constraints, all nicely held in an array data structure ready for real query building.