Move pattern compiler to own class

By moving the pattern compiler to its own class we get a better
separation of concerns - PatternRepository is for loading patterns (and
gettting a compiled version), PatternCompiler is for compiling and can
be used with dicts from other sources than PatternRepository.