Various bug fixes, refactoring, and additional testing.

In working with the filter I found a number of bugs including inability to replace whitespace with nothing and a failure if a partial phrase match was unresolved at the end of a document (document didn't index). I've also extended the testing and refactored a number of things including simplifying the token filter and extracting parameters into their own class.