Improved query validation.
Whitespace fix.
Merge branch 'mlucy_2313' into next
Merge branch 'next' of github.com:rethinkdb/rethinkdb into next