First attempt to support the "aggregate" function within mongo.