Re-work a bunch of style issues in the code, as indicated by rubocop

I have used [rubocop](https://github.com/bbatsov/rubocop) to apply some of the guideilnes from the [ruby style guide](https://github.com/bbatsov/ruby-style-guide).

Not everything has been applied but it seems like a good start.

fixes #65