Replaced Aho-Corasick algorithm implementation.
This one is better.