Check for existence of ldapsearch command.
Refactored LDAP functions and configuration.
Use new ldap functions.