The randomizer is full of global mutable state. This is a problem, because future enhancements to the GUI may want to run the randomizer in multiple threads simultaneously, if nothing else to take advantage of I/O parallelism.
Fortunately, this is easy to achieve by placing the relevant code into a class.