refactoring mongo.distinct and mongo.parse.ns and adding RUnit tests