Error checking for missing patterns

PatternRepository now raises a KeyError when it finds a pettern that is
not in the pattern dictionary.