Distribute the random generator state

- Make the random generators take a value of Random.State.t as a
  parameter. This will allow the state of the random generator to be
  saved before running a test, and hence repeatable tests can be run.