Auto-format code using RubyCop 0.28.0

Command used: `rubocop --rails --auto-correct`

Also add some RuboCop configuration and manual corrections.