Added random number generator parameter

A `random` argument can be provided to the function, consisting of
a function taking an argument and returning random numbers from
zero, up to said argument.

There is also a `random` property in `module.exports`, which is
used as the default if the `random` argument is not provided, and
which defaults to the current random number generation algorithm.