Support for mongo URLs (required for Heroku)

This change enables support for mongo URLs provided Db.connect().

My earlier pull request was incomplete. This code actually works. Really I should write some tests though.