Use a cryptographically secure pseudorandom number generator

Squashed all of the commits into a single commit.

See also: #128, #130
The parameter is not needed here as it's the default value.