Refactor of dht api out of libtorrent.i.