Ldap has the potential to slow down compiles if a search takes too long.
Here we add timing information to the debug output, so that in case of
question, we can at least have a method of determining the time a given
search took.
Testing the methods inside of the function is a complete pain. This
moves the code out to use the PuppetX pattern and adds some basic unit
tests that validate the logic.