router: implemented optimiser for match rules

With many matches, it quickly gets *very* expensive to determine a
metric is not going to be matched, because all of the matches have to be
performed.  Therefore, introduce groups, based on common strings (on the
tail actually) in the matches, via which large groups of matches can be
excluded after testing the group common bit.  This works very well if
the input metrics share a tail, but of course if this isn't the case,
this optimiser doesn't do much.
router_printconfig: don't mix tabs with spaces
bump