This work adds support for setting the scope of a given query. This
allows retrieval of a specific objects, or searching at a specific level
of the tree for the desired results.
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.