Cleaned up Ruby & CSS code

Cleaned up the Ruby code to make it more internally consistent, and to follow the Ruby Style Guide (https://github.com/styleguide/ruby). 

Also cleaned up the CSS code.