Added MongoURI configuration option

I've committed some changes to allow configuration via MongoURI. The new code will extract database and credentials form the MongoURI if provided with a fallback on the existing configuration options.