Add ldap_query, mutt friendly refactor from original script by Kaz.