Upgrade Rails and some other fixes

This what I had to do to get the app running on my machine with the latest version of Rails, which has some necessary security patches.

Please see individual commit notes for more details.