refactoring HMM: added a ModelManager to handle creating words and sentences