Use predictable number generator in MonteCarlo tests
Refactor weighted generators to use an internal generator

This allows isolating the random component to a single class, and
making more tests deterministic.