Query debugging option

Call setDebugging(true) on a query object to enable.
Any errors are thrown as Exceptions.