First stub of markov_diffusion refactor.
Tidying up, formatting, docstings.