add random element function

Really simple random array element function, done in a way that should support old and new versions of ruby.