Import Vince Durham's aux proof of work implementation.
Support auxillary proof of work.

Rebased from 1.7.1 into 1.7.2, moved AuxPoW checks from AcceptBlock()
into AcceptBlockHeader()
Enable RPC commands for mining aux proof of work blocks.
Replace getauxblock CBigNum with CScriptNum
send auxpow debug info to debug.log instead of stdout
extracted auxpow consts

set testnet start of auxpow to block 158100
Set chain id to 0x0062

0x0062 is 98 in decimal. Dedicated to Josh Wise.
Make version check in UpdateTip() consider auxpow block version
Merge pull request #584 from patricklodder/1.8-dev-auxpow

Enable auxpow for Dogecoin
Revert unneeded changes introduced as a side-effect AuxPoW.
Updated version number to 1.8.
Tidy up retargeting code and debug.log output.

- remove unused int64_t retargetSpacing
- modulate timespan in an isolated int64_t nModulatedTimespan
- keep nActualTimespan intact, to retain the original value
- compress debug.log output from 5 into 3 lines while retaining
  all information.
version bump

version bump
Break testnet difficulty reset out of never matching condition.

Testnet resets difficulty if after 2 minutes no block has been
found. However, this feature was implemented with the condition
to only trigger on blocks where no retargeting is done. Since
the introduction of DigiShield, we retarget at every block,
making this condition never to be matched. This commit removes
that condition.

WARNING: THIS COMMIT HARDFORKS THE DOGECOIN TESTNET!

The main network is not affected by this change.
Check against the right aux block version number

Previous commit 9e9babb was based on a wrong assumption, actual
CBlockHeader->nVersion for auxpow blocks is
CBlockHeader::CURRENT_VERSION | (AUXPOW_CHAIN_ID
   * BLOCK_VERSION_CHAIN_START)

and not BLOCK_VERSION_AUXPOW
Merge pull request #587 from rnicoll/1.8-dev-version

Updated version number to 1.8
Merge pull request #590 from sigwo/1.8-dev

version bump
Merge pull request #585 from rnicoll/1.8-dev-cleaning

Revert unneeded changes introduced as a side-effect AuxPoW.
Merge pull request #588 from patricklodder/1.8-dev-retargeting

Tidy up retargeting code and it's debug.log output
Merge pull request #589 from patricklodder/1.8-dev-testnet-retarget

Break testnet difficulty reset out of never matching condition.