Move wallet db functionality to libcoin Wallet class.