IsMine isn't used outside of the wallet except for the tests. It also doesn't make sense to be outside of the wallet. This PR moves IsMine into the wallet module and for it to take a CWallet instead of CKeyStore. The test that used IsMine is also moved to the wallet tests.
This is first prerequisites for the wallet structure changes.