Decouple CChain from mapBlockIndex
Move CBlockIndex, CChain and related code out of main
Reinitializing list's begin iterator after few elements were erased from the head
Apply clang-format on crypto/* and compat/*
SanitizeString: allow '(' and ')'

'(' and ')' are valid in user agent strings, so should be reported
as such in RPC `getpeerinfo`.

Fixes #4537.
Fixing C4146 warning

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Merge pull request #4823

1e73504 Fixing C4146 warning (ENikS)
Merge pull request #4969

cda45b5 Reinitializing list's begin iterator after few elements were erased from the head (ENikS)
depends: add the debug/release concept to depends
depends: add debug/release flags for linux/osx/win

Linux and mingw enable libstdc++ debugging for extra runtime checks. OSX
doesn't play nice, so don't enable it there.
depends: make sure openssl sees cppflags
depends: boost: build for debug or release as requested

Also hook up cppflags there, which was missing before.
depends: teach qt to honor debug/release

This means it also needs to honor our flags, so patch them in as necessary.
depends: give miniupnpc cppflags
depends: make LDFLAGS act like the other flags
depends: add docs for debug
depends: disable reduced exports for debug builds

Some debug options may not be compatible.
tests: don't split an empty string
script: don't read past the end
travis: use debug for one build

For the all-off build, enable the wallet and debug. This ensures that debug
options will catch wallet problems as well.

In order to make sure the no-wallet path is still tested, disable the wallet
in the other x86_64 build.