NetworkInformation: Rewrite IP address preference code

- Prefer LAN addresses by type instead of name over other links
- Prefer IPv4 addresses over IPv6 addresses until we've found a way to
  detect what the environment supports.
Embed IPv6 addresses in brackets when putting them in an URI