Rails 4, Refinery 3 compatibility

All the tests pass, but feedback is very welcome.