Refactoring, unit tests on adding words and on Trainer