Work in progress support for Rails 4

This is work in progress because it still has failing tests, but only a few!

I'm opening this for transparency and so that people can help! :+1: 

cc @ugisozols