Re-factored ldap app

Moved ldap code to file ldap.py from views.py