move rand functions from util to new random.h/.cpp