1) parsing of 'ns' moved into standalone function for reuse.
2) mongo.aggregation pipeline added. Thanks to stackoverflow threads: http://stackoverflow.com/questions/13594714/group-by-in-rmongodb
http://stackoverflow.com/questions/16367408/how-to-access-mongodbs-aggregation-framework-from-the-rmongodb-r-package