Code & Doco cleanup

I don't know the state of this project, so you may or may not want this PR.

I reformatted all the files (fixed indentation, stripped trailing whitespace, wrapped lines so they were actually readable), added proper doco to the Robot module, fixed exception handling, found and fixed (maybe?) a couple small bugs (again, maybe?).

Even if you want this PR, you might not want the last commit, which is the only real functional change I did which was to sort the leaderboard and the output.