Improve matching test infrastructure

This way has more flexibility (both for new match types and new
matchers).