Extract matching routine and add some alternatives
Merge commit 'f6d5581254'

Extract matching code and supply a second matching strategy that might
be used as an alternative.