Start using RuboCop

This PR introduces RuboCop, fixing #286.

Several of RuboCop's 'cops' are configured to RuboCop to match the style of the current code base (for example, we use multiline method-chaining in several places, and it seems silly to rewrite that code), and also according to my own taste. Many other offenses have been fixed, in particular those that RuboCop can correct by itself.

I have kept corrections and/or fixes for each cop in a separate commit, so if there is any style issue for which we conclude that a different choice should be made, we can fix it by removing or amending that commit.

The StringLiterals cop has been disabled until a consensus is reached (which might be to leave it disabled). See  #286 for discussion.