Rails 4 updates

Probably don't want to put this in master just yet, but a rails4 branch would be helpful. Not sure I got everything, but it's a start.