Style clean-up and small refactors

Hi there,

This is mostly a cosmetic PR and small refactoring to clean up styles according to the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide). Feedback welcome.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.