ipv6-regression-fix

This should (may) finish fixing the regressions caused by earlier IPv6 fixes. Some environments did not tolerate having the brackets around anything that wasn't an IPv6 address.

It looks to me like a clean and reliable way to ensure that the brackets get added only to IPv6 addresses and not IPv4 addresses or hostnames, but I'm open to input and certainly more testing.
The effort is probably not justified over a temporary hack. This is just to get the broken nodes up quickly. We don't actually want to best testing for ipv6 everywhere anyway.

Doing things right would take a lot more time and thought. I think we can squeeze by here without having to seriously address ipv4/6 duality just yet.