Initial implementation of finite automata string matching.
Fixed bug in main.