Changing Math.random with Random.random

Changing all occurrences of random functions to Random.random. This way
we can fix the random sequence and be able to guide tests and repeat
results.