Updated random functions.

Random functions now use arc4random_uniform, this should reduce bias on
the returned numbers.