make bittorrent-dht extendible.

the end goal of this patchset is this:
https://github.com/xaiki/dht-exp/blob/master/dht.js

basically, be able to implement other extensions, and use your awesome code for moar things.

first patch is needed to make tests pass,
second patch adds ipv6 support, for free.

then we put together and export easy helper functions.
b9f62ee is not actually needed, but I think it's nice.

cheers.
Is there a good reason for using `process.env`? We don't do this for any of the other options.