Use a new DHT library, and more cleanups