Pass the query as the 'q' parameter
Unify the tile and grid parameters.

They were originally separate since they needed different SQL queries,
but the differences are all handled at the python level now.