Various fixes and tests.

* Import modules, not names.
* Stricten port tests.
* Test is_ipv6_address.
* Fix docstrings and test get_peer_url.