Lps 52040

Part of LPS-52040 is done here.

Essentially moving stuff needed for services. Still need to isolate other LDAP-related code and refactoring