Support both standalone and replica sets mongodb

Replace hosts, username and password options with the uri option. The
uri option supports the mongodb uri specification, and thus both
standalone and replica sets can be used. Connection specific options are
also supported by the URI specification.