math: fix docs for next-power-of-2 and some tests.
random: faster random-bits, make some things private.