Initial commit, with first pass at functional markov chain representation