Started support for queries. Renamed aql to query to denote its general query-ness.