Moved random number generation into the IR.

I removed the state and the runtime module, and instead index a fixed psuedo-random permutation driven by the free vars, any rvars, an optional seed, a unique ID per random variable created, and a unique ID per function definition.

This also makes RNG deterministic in parallel code, where the old solution allowed race conditions.

In a cute bit of number theory, the random permutation is given by a simple quadratic in 32-bit integers, so this is a really really fast RNG.