Minor refactor.

Added newlines to generated Java code. Refactored random number
generator to a single RNG.