RegexClassifier refactoring, unit tests for RegexClassifier