Revert "Reworked pattern matching. Fixes #7."

This reverts commit 1d5d748bb709c736b4d36ef06a92cb649e9523b0.
Revert "Revert "Reworked pattern matching. Fixes #7.""

This reverts commit b5fc305967fafa34c4617fc9abf5d61196c873e9.
Missing file for #7 fix, the PatternMatcher definition.
Fixes #7.