LDAP authentication unit tests

Using mockldap, add user authentication unit tests with LDAP backend
Also fix a corner case with the filter not having parentheses in the
ldapBackend which had mockldap complain.