Refactor ActionDispatch::RemoteIp

Refactored IP address checking in `ActionDispatch::RemoteIp` to rely on
the `IPAddr` class instead of the unwieldly regular expression to match
IP addresses. This commit keeps the same api but allows users to pass
`IPAddr` objects to `config.action_dispatch.trusted_proxies` in addition
to passing strings and regular expressions.

Example:

    # config/environments/production.rb
    config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.16')
What other exceptions can `IPAddr.new` raise that a blanket `rescue nil` would mask? Is there a specific exception we can rescue, instead?

Also, can user-provided headers sneak e.g. a netmask into an IP this way?