Upgrade to Rails 4

Thanks to everyone who helped with this. Finally the tests pass so this is PR-able. Sorry, this is giant. :sunny:
Following on from @jamiecobbett's comment, we don't need bootstrap-sass either.