Pattern matching refactoring

Renames TrieXXX classes into PatternXXX classes
Refactor part of the matching algo into an extra Pattern implementation