Fix deprecation warnings for Rails 4

I noticed some deprecation warnings happening due to some slight changes in Rails 4 and thought I'd fix them.

The only one I couldn't get rid of is the Mocha deprecation warning:

`Change require 'mocha' to require 'mocha/setup'`

This seems to be coming from some gem needed in the project, as the only reference to mocha that I could find has the correct `require` statement.