Refactoring and unit testing of routingtable (part 1).

### Motivation
The `routingtable.py` module has fallen out of sync with the rest of the project in terms of documentation and use. It has a number of bugs and design flaws, and none of its code is tested. This PR refactors most of the minor functional units of the module, fixes a few bugs and installs unit tests for all of the new code as well as most of the existing code, too. There will be a second PR adressing the design issues and more severe bugs head-on.

### Roadmap:
* Make `RoutingTable` thread-safe by installing a lock on each `KBucket`.
* Move `splitBucket` method to `KBucket` class.
* Create a `SmartKBucket` that inherits `KBucket` and manages its own `replacement_cache`. Override `KBucket.splitBucket` by `SmartKBucket.splitBucket` so as to ensure the `replacement_cache` stays in sync with the `KBucket`.
* Refactor `OptimizedTreeRoutingTable` to use `SmartKBucket`s.
Indeed.