MatchResult class; replace tuples; fix unit tests