Codebase cleanup.

While this started out as a hack for a CTF weekend, I'm now making
it presentable.