add Knuth-Morris-Pratt implementation, more testing