Added patternmanager class

implemented some of the pattern recognizer, but it still needs work