Merge and cleanup all random number generating functions.
It is meant that this patch does not change the code, just clean it up. They are a few places where the code is changed a tiny bit (off by one errors). Also this patch only cleans up style errors in the random function, not other style errors in code.