WIP Almost complete refactoring and unit testing of routingtable. Minor refactoring of kbucket.

Very WIP. I will describe tomorrow; really tired now.