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

Very WIP. I will describe tomorrow; really tired now.

### Bugs found:
* Many operations are potentially thread-unsafe.
* The `replacement_cache` isn't synchronized once a `KBucket` is split.
:+1:  I have the feeling that market_id is only used for storing different 'markets' in the database. If this is the case why not use completly different databases instead of passing a market_id all over the place for every db access?