Remove #define loop from util.h

Replace the loop macro with while (true). The #define caused
problems for Qt.
Merge pull request #2866 from gavinandresen/loopdefine

Remove #define loop from util.h
Minor miner fixes (hey hey it's fun to say)

* Fix UpdateCoins() definition in main.h
* Remove pwalletMain reference from BitcoinMiner(), as it is passed
  a wallet argument.
Move internal miner/block creation to separate miner.cpp module.

Public functions referenced elsewhere are added to miner.h.
Merge pull request #2867 from jgarzik/miner-sep

Move internal miner to separate miner.cpp module
Add support for watch-only addresses

Changes:
* Add Add/Have WatchOnly methods to CKeyStore, and implementations
  in CBasicKeyStore.
* Add similar methods to CWallet, and support entries for it in
  CWalletDB.
* Make IsMine in script/wallet return a new enum 'isminetype',
  rather than a boolean. This allows distinguishing between
  spendable and unspendable coins.
* Add a field fSpendable to COutput (GetAvailableCoins' return type).

Based on a patch by Eric Lombrozo.