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.
Place the . on the previous line, together with the method call receiver.<br>Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.