Move random functions into their own module