ldap search improvments. and some more. WIP.