Finished Mongo adaptor, cleaner up code, added comments