Cleanup mongodb authentication

Authenticate to the database before getting a reference to the
collection.
Merge pull request #23 from rocha/clean-up-mongo-authentication

Cleanup mongodb authentication