Clean up code

There were quite a few inconsistencies in style in the project, so, because I don't want to have to think about how I should format my contributions, I:

1. used Rubocop to tease out what the majority conventions were,
2. made the code consistent with these conventions, and
3. added Rubocop to the default Rake task to keep things consistent.