I made the function, makeMarkovPhraseModelFromElementMat.

ran into some glitches with it but it seems fixable.

1/31/13