Split random number generation out into core/random.c, and create the