Metropolis-Hastings iterator class