attempt to make LDAP provider to work with generic ldap configurations

Hello.
I've tried to move to the configuration some parameters to make the ldap provider work with standard LDAP tree without breaking the existing code.
Unfortunately some tests still fail, but It seems that the tests need to be updated.
The provider works on a live system with OpenLDAP.

Thanks, 
Alex