Refactor and test ldap::connection