Add tests to the wallet.py module

This branch adds a lot of tests to the wallet.py module.

Most key management methods are covered, but there is still room for improvement around signatures (transaction and message signatures, mostly).
As a side effect this branch increases code coverage of the bitcoin.py module as well.

(I rebased this against master. I even squashed some commits :) )