Add a random function for the lulz.
Fixes for ruby 1.8.7 compatibilty.