refactors MarkovNode and TriGram to be a little more manageable