Drop support for ruby 1.8 and activerecord 2

@abenari As discussed in #89.

- I updated the gem spec and Travis build matrix to drop support for Ruby 1.8 and ActiveRecord 2.
- I also updated a bunch of code to use newer ActiveRecord APIs, to prevent a bunch of deprecation warnings.