Fix many code style issues

A lot of bad style things crept in over the years making the code
squashed and non-uniformed.

This fixes a number of issues highlighted by Rubocop.
Merge pull request #46 from brightbox/style_issues

Fix many code style issues