refactor messy LDAP code

unified connection/login checking
disable authorization caching fixes #296