matcher abstraction finished and used

Needs some more restructuring and doc updates.