Mongodb 2.1+ aggregate function

Turned "group" mongodb statment into "aggregate" that is dramatically faster, but mongodb 2.1+ must be used.