Refactor Pattern and PatternList. Probably doesn't work yet.