Abstract out wallet tracking function.

This will soon be used to also implement tracking of utxo and txs for
address in this wallet.