mongoconnect class

* Rewrote mongoconnect as a class
* Updated main to reflect structural changes