Support Rails 4

I am sending a pull request for the Rails 4 branch, I believe we are almost ready. Thanks guys for all your work!

Giving the changes in the PR, it seems possible to support both Rails 3.2 and Rails 4. Most of the changes are actually in the testing side. What do you guys think? Should we change this pull request to revert support to both?

:heart_decoration: