Allow overriding of all headers from passed environment hash

Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.

Fixes #11590
Privatize non-test method
Use Ruby 2.0 caller_locations instead of caller if available

* we no more have to manipulate the each caller strings by ourselves using caller_locations

* caller_locations runs slightly faster, and creates less objects than good old caller
Benchmark (loading an Engine 1000 times):
  caller: 262.89 ms
  caller_locations: 186.068 ms
Clean up unused associations in AR test model
More unused associations in AR test models
change function def self.table_name to self.table_name