TxCache: Some refactoring of the Transaction tx_cache code
TxCache: Some refactoring of the Transaction tx_cache code

- Added external interface to the foreign tx cache: tx_cache_get and
tx_cache_put

- Made the fetch input data code a bit more resilient to bad / bogus
data coming from network

- Refactored the txid calculation code to use a re-usable static method:
_txid() which just takes the appropriate double hash of the input raw
hex string, so we may re-use this code in our own sanity checks

fyookball/electrum,fyookball/electrum,fyookball/electrum