Decouple CChain from mapBlockIndex
Move CBlockIndex, CChain and related code out of main
CMessageHeader sanity changes

- Remove spurious `pchCommand[1] = 1` in CMessageHeader()
- Make sure that pchCommand is zero-padded if length is shorter than
  COMMAND_SIZE
- Use strnlen to determine length of pcmCommand in GetCommand
build: fix release name strings for gitian builds

When building from a distdir as gitian does, checking for the .git dir
is not reliable. Instead, ask git if we're in a repo.
Fixing improper input syntax and failing bounds check
remove code below asserts in limitedmap.h (fixes a ToDo)
Use actually valid transactions for script tests
Add actual signature tests
[Qt] minor changes in splashscreen.cpp

- guard an unused variable with Q_UNUSED() macro
- remove a commented out line of code
Grammar fixes in README

Github-Pull: #4956
Fixing out of bounds error in GetKey()
Merge pull request #4962

6f3ae9b Fixing out of bounds error in GetKey() (ENikS)
Merge pull request #4949

c8589bf Add actual signature tests (Pieter Wuille)
76ec867 Use actually valid transactions for script tests (Pieter Wuille)
Fixing out of bounds asses error
Avoiding referencing elements of an empty vector
Merge pull request #4955

87314c1 Fixing improper input syntax and failing bounds check (ENikS)
Reinitializing list's begin iterator after few elements were erased from the head
Do merkle root and txid duplicates check simultaneously

Move the txid duplicates check into BuildMerkleTree, where it can be done
much more efficiently (without needing to build a full txid set to detect
duplicates).

The previous version (using the std::set<uint256> to detect duplicates) was
also slightly too weak. A block mined with actual duplicate transactions
(which is invalid, due to the inputs of the duplicated transactions being
seen as double spends) would trigger the duplicates logic, resulting in the
block not being stored on disk, and rerequested. This change fixes that by
only triggering in the case of duplicated transactions that can actually
result in an identical merkle root.
Fixed typo in README.md file. "-regest" "-regtest"

There was a typo in the README.md file. It previously read "-regest" instead of the proper "-regtest" and it has been updated to the proper reading.
Merge pull request #4974

b498a94 Fixed typo in README.md file. "-regest" "-regtest" (Eric Shaw)