Performed a bit more testing on matching logic.  So far (based on simple manual testing) everything looks correct, aside from issues already noted in TODO comments