Update Rails to 3.1.11 to avoid CVE-2013-0276

Also upgrade Mocha to be compatible with new Rails. These are already
applied to master.