match: move body of _normalize() to a static function
matcher._normalize() no longer depends on any of the matcher's state,
and making it static will enable further refactoring. Note that the
subdirmatcher subclass calls _normalize(), so we can't remove it
completely.