Implement match-checker

Checks that a given tree-pattern matches a given tree.