Accept all formats of new-style connection hints

The general parsing code for endpoint strings and the specific parsing code for
TCP client endpoint strings has been copied from Twisted, because there is no
public API for parsing or generating endpoint strings. It will be removed after
the switch to endpoints.

Source: https://github.com/twisted/twisted
Git commit: c139e22c7abc705114fd4f0e8afde8364e06f918