Updated db authentication code

Also added setupDB() function to test/setup.py
to add username and password to local
MongoDB database.