Add support for mongodb authentication

As long as MONGO_USER is left empty authentication won't be attempted. The user used to authenticate needs to have been granted the readWrite role on the configured database.