Massive cleanup

There is no functional changes, just style changes and some
minor refactors to make everything consistent and clean.

Yay! Rubocop!