Fixes #414 - integrates rubocop gem

Adds rubocop gem and fixes majority of issues noted by cop.
While you're cleaning things up in this file, could you please also surround `=` with a space? Thanks!