Separate out Query function into query() and queryWithVars

Posted by deepakjois:

Like in the Go client.