Query object

This is a  bunch of constructor functions for the query object.