Refactor dhtid class from scratch

Using new Makefile structure.