Support calling build_rdn() and build_dn() on a class.

This makes it possible to obtain the DN for an LDAP object without
having to fetch from LDAP first.
Wrap up connection obtaining code in _get_connection().
Support binding to a different database alias using bind_as().
Support restoring settings.DATABASES after bind_as().
Add a context manager interface for bind_as() + restore_alias().
Add tests for bind_as().
Do not ever replace dicts from settings.DATABASES.

Since django provides no sane way of removing a connection once
instantiated, each alias is bound to the dict it had at instantiation
time. Therefore, make sure to always use the same dict, modifying it as
necessary.