Changes due to binlain

Adopting changes from https://github.com/binlain/lightdht/commit/622d66e85ed965bf9efb9d30be2f48935032b06d
Merging by hand due to space/tab differences.
Cleanup

Clean up docstrings and typos.