Integrated mongodb driver code

Mongoose is a bit slow in comparison with the driver (about 1/2 of the performance) so changed it to use the mongodb driver directly