fix possible infinite loop in intro.cpp thread

- it was possible to trigger an infinite loop in FreespaceChecker::check() by
  simply removing the drive letter on Windows (which leads to an infinite
  loop in the FreespaceChecker thread)
- this was caused by not checking if we make progress with
  parentDir.parent_path()
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
Merge pull request #2850 from Diapolo/fix_intro

fix possible infinite loop in intro.cpp thread
GetDataDir(): cache paths for each network separately
Refactor: CAddressBookData for mapAddressBook

Straight refactor, so mapAddressBook stores a CAddressBookData
(which just contains a std::string) instead of a std::string.

Preparation for payment protocol work, which will add the notion
of refund addresses to the address book.
Refactor: Move GetAccountAddresses to CWallet
update SelectParamsFromCommandLine() handling/order

- move SelectParamsFromCommandLine() from init.cpp to bitcoin.cpp to allow
  to use TestNet() for Bitcoin-Qt instead of GetBoolArg("-testnet", false)
- change order in bitcoind.cpp to match bitcoin.cpp functionality
- hamonize error message strings for missing datadir and failing
  SelectParamsFromCommandLine() in bitcoin.cpp and bitcoind.cpp
- use TestNet() call in splashscreen.cpp
Rework when payment server is started
Route qDebug() messages to debug.log
Payment Protocol: X509-validated payment requests

Add support for a Payment Protocol to Bitcoin-Qt.

Payment messages are protocol-buffer encoded and communicated over
http(s), so this adds a dependency on the Google protocol buffer
library, and requires Qt with OpenSSL support.