The Refactoring

Commit early, commit often, that's what I always say! I tried to keep the
commits really tiny so you could see my process with each one. The easiest
way to follow along is probably on GitHub, you can see the list of commits
by going here.
Check each one in order, as they build upon each other.

The OO version

After the Great Refactoring, what's left is a shiny new version with lots of
objects. It happens to all of us eventually... anyway, you can check it
out here.