Working Rails 4.1 support

Tests pass for me (`bundle exec rake`). All the info you need should be in the comments. Currently using this in our dev environments without any trouble.