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