Converted to use Mongo 2.6 aggregation framework

We were using map-reduce.