Work on fixed pattern matcher
MAJOR refactoring of the pattern matcher.
NORMAL merged pattern matcher refactoring into the main branch.