(#22142) Substantial speed increase in lookups

Previously, hiera would look up the 'datadir' from config
inside the loop where it looks inside datafiles. This caused
substantial slowdowns on sites with deep hierarchies.

This commit moves the datadir lookup to be outside the
the datasource-search loop and caused substantial speedups.
(Timings are in the original ticket).

This patch was written by Sean Millichamp; I just rebased it
onto the current state of Hiera and submitted it on his behalf.
(#22142) Extract method to list all hierarchy files

The patch to reduce the work done when traversing the hierarchy
duplicated the datafile() method from Backend. This removes the
duplicate code from the yaml backend and creates a new method on Backend
to get just the files associated with the hierarchy.
Merge pull request #191 from hlindberg/HI-239-cherry-pick-speedup-from-master

(HI-239) Cherry pick speedup from master (from #22142)