Address middleware insertion order for threadsafety

Rails 4 is threadsafe by default
Fix production mailing configuration

Conflicts:
	config/environments/production.rb
Remove rewrites

Conflicts:
	Gemfile.lock