Handle hosts with colons (IPv6)

We should use the (Join|Split)HostPort functions instead of manually splitting or joining with ":". This may not be sufficient to fix support for IPv6 addresses, but it's necessary.