Add Rubocop and do a bunch of refactoring to comply with style