Refactor backuptool.

* Fix docstrings.
* Raise NotImplementedError if BackupTool.restore is invoked.
* Avoid os.sep; use os.path.join for buliding paths.
* Also delegate separator handling to os.path.join.
* Catch only OSError and tarfile.TarError.
* Use classmethod instead of staticmethod when the name of the class
  appears inside the method, to ease possible future refactoring.
* Simplify get_backups; reverse list in-place, filter None objects.
* Refactor get_backup.
  * Print warning on bad backup path.
  * Strip try..except to absolute minimum.
  * Ensure tarfile is always closed.
  * Print error on exception; return after callback.
* Do not mess with sensitive magic methods.
* Define __repr__ via to_dict; derive __str__ automatically.
* Move testing code to appropriate directory.
* Style fixes.
Merge pull request #834 from Renelvon/sane_backuptool

Refactor and initial tests for backuptool.
fix logger not rotating log files except on startup/shutdown

Signed-off-by: Thomas Stilwell <stilwellt@openlabs.co>
Merge pull request #835 from benemorius/fix-logfile-maxsize

fix logger not rotating log files except on startup/shutdown
Migrate to bitcoin from pybitcointools. Fix #552.

* Replace privtopub with privkey_to_pubkey.
Merge pull request #842 from Renelvon/bitcoin

Migrate from pybitcointools to bitcoin.
Do not log image data in any circumstances
Silences unnecessary error log on shutdown.
Merge pull request #851 from gubatron/transport-shutdown-fix

Silences unnecessary error log on shutdown.
Merge pull request #848 from dionyziz/log_no_images

Do not log image data in any circumstances. (part 1)
Delegate splitting to the KBucket.

* A KBucket should handle the details of its splitting. This
  will enable using different subclasses of KBucket with the
  RoutingTable. It is also necessary to write thread-safe code.
* Test kbucket.splitKBucket.
Add and test MemKBucket.

* Test MemKbucket initialization.
* Test MemKbucket against the superclass testsuite.
* Model replacement cache as a deque.
* Test cache-splitting.
* Test contact replacement from cache.
Protect access to KBucket attributes via an RLock.

* A Kbucket is now a thread-safe object.
Replace TreeRoutingTable by OptimizedTreeRoutingTable.

* Dump splitKBucket inside addContact.
* Some docstring fixes.
* Drop TreeRoutingTable from the testsuite.
* Test removing absent contact should not throw ValueError.
Only return all contacts if count is negative.

* Fix a bug where OptimizedTreeRoutingTable.findCloseNodes would return
  more nodes than requested.
Test addContact.

* Tests ported from the drogulus project.
* Disallow adding self in the RoutingTable.
Test and minor refactor findCloseNodes.

* Tests ported from the drogulus project.