Code cleanup, faster multinomial sampler, preparatio for forward
simulations followed by inference.