connecting to mongo databases with password protection

We didn't support connecting to a database that needed to be logged in to.

This branch includes the implementation and a unit test for fixing this