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')