Update to support Rails 4

* Drops support for Ruby 1.8
* Drops support for Rails prior to 4.0
* Misc style updates for newer AR scopes/arel