small bit of cleanup
adds tests, comments and makes the plugins use the new StringMatcher.