Implemented a simple state machine for the Aho-Corasick algorithm