Add support for LDAP Authentication

And fix a few bugs/issues.