loadMatcherFuncs function

I had nearly identical logic in two places, so I refactored it into a function that could be called in both places.