A library for handling markov chains