Updated to have more correct random piece logic.

Also worked on making some of the logic a little easier to follow.
The "terminal" version is done.

Isn't the cleanest thing in the world.  Not exactly a large codebase,
yet.  Overall, I'm happy with how it turned out.