began working on the mongodb port
finished porting to mongodb
added newlines and escaping