Use CWalletScanState, CKeyMetadata, CAffectedKeysVisitor

Use CWalletScanState, CKeyMetadata, CAffectedKeysVisitor