Setup rubocop.

Closes #702.
No, the cop suggested aligning `when` with `case`, and I noticed we were using `return` unnecessarily.  Once I addressed that, it felt natural to put it all on one line with `then`.