[rand] Redo the module to be more useful and clear.