Adding support for a pre-aggregation pipeline, and for first and last operators for Mongo2.