Upgrade to Rails 4

Still a work in progress.