Refactoring of get_shared_key() in DHT.c

Wasn't soley a function refactor, the structs it uses were also modified, and as a result some function calls have changed.
Everything is explained in the commit messages.

I left this as a TODO because I had no idea what to make of it. Irungentoo, what is that constant used for?