Added modular lib version of markov chain class