Some cleanup of dhtlib and sample code