Added first/last n query types.  Renamed key first/last queries for consistency.