Disentangle connection.py and dht.py