Primecoin: Fix mining code crashes when doing a -reindex.

GeneratePrimeTable() was not called when starting with the -reindex option.
Check that pindexBest is not NULL in BitcoinMiner().
Primecoin: Merge with Bitcoin v0.8.5

Conflicts:
	bitcoin-qt.pro
	doc/README.md
	doc/README_windows.txt
	share/setup.nsi
	src/checkpoints.cpp
Fix for multiple machines doing the same work if wallet is shared.

Initialize the extra nonce using the current value of a nanosecond-precision clock.
Boost.Chrono library is now required for compiling.
Fix block submission using getwork RPC command

Passing the prime chain multiplier in "getwork" RPC command was fixed in
order to be usable for block submission.
Remove chainspermin and primespersec from the output of 'getmininginfo' because they are not useful metrics anymore.
Add extensive chain statistics to debug.log.

Compact statistics are printed every minute.
Full cumulative statistics are printed when shutting down the miner.
New dependency on Boost Timer library.
Remove the unused nPrimorialSeq from CPrimalityTestParams.
Remove chainspermin because commit 105a7fe590 provides better info.
Remove -sievepercentage in favor of -sievefilterprimes.

-sievefilterprimes takes the exact number of primes that will be filtered out by the sieve.
Decoupled the size of the prime table and -sievesize.
-sievesize can now be changed on the fly.
Added new option -l1cachesize which allows specifying the L1 cache size (in bytes).
Add a new blocks/day estimate.
The automatic primorial adjustment is now guided by this new estimate.
Adjust round primorial based on last 40 rounds.
Added a new option -primorial to allowing using a fixed primorial.
Move the allocation of both CSieveOfEratosthenes and CPrimalityTestParams to BitcoinMiner().
Primecoin: Merge with Bitcoin v0.8.6

Conflicts:
	README.md
	bitcoin-qt.pro
	doc/README.md
	share/setup.nsi
	src/main.cpp
Change the -printprimorial debugging message a bit.
Print one line per printf() in PrintMinerStatistics().
This looks more sensible now that log timestamps are enabled by default (since Bitcoin 0.8.6).
Remove double timestamps from primemeter and chainstats if fLogTimestamps is set.
Fix blocks/day estimate if -sievetargetlength is used.
Implement Primecoin v0.2 proposal.
The block header hash is required to be a probable prime that passes the Fermat test.