add rng reproduction unit tests and fixup ctor, discard

This commit adds some unit tests which test reproducibility of the
rng from the info that we store in configs.

The unit tests do things like, construct an rng in any of several
ways, use it a bit, get its state to a config, construct a 2nd rng
and test that these have equal state / give equal random draws.

The code fixups are to be more disciplined about using the
random_calls_ variable, initializing to zero and always setting
using the seed function. The discard function now uses
get_next_random rather than mt_(), so that it atomically counts
the number of random calls.