use lower order bits in prng

- This is about 2 times faster compared to the previous rng.
- Add unit tests to ensure things are correct