Post-compo code cleanup

I tried to make this a bit more legible, since it'll be up here forever.
There are bugs, etc that I could fix, but I chose not to. These changes
shouldn't visibly affect the game.

Changed variable and function names, added whitespace, added comments,
reordered statements. Added a ClockUtil class which handles
entity-entity collisions, since that code was copypasted many times.