Moved random related stuff into util.Rand object.