Refactoring code to allow easier testing of alternative matching strategies.  The live version will eventually be updated to match the changes being made here.