Merge pull request #1981 from sipa/caches

Cache size optimizations
Add CBufferedFile
LoadExternalBlockFile switched to CBufferedFile
Move ThreadImport to init.cpp
Add -reindex, to perform in-place reindexing of block chain files

Flushes the blktree/ and coins/ databases, and reindexes the
block chain files, as if their contents was loaded via -loadblock.

Based on earlier work by Jeff Garzik.
don't use memset() in privacy/security relevant code parts

As memset() can be optimized out by a compiler it should not be used in
privacy/security relevant code parts. OpenSSL provides the safe
OPENSSL_cleanse() function in crypto.h, which perfectly does the job of
clean and overwrite data.

For details see: http://www.viva64.com/en/b/0178/

- change memset() to OPENSSL_cleanse() where appropriate
- change a hard-coded number from netbase.cpp into a sizeof()
make CBase58Data class use zero_after_free_allocator

- this way there is no need for an explicit destructor, who does the same
  thing anyway
Merge pull request #1978 from sipa/nodetach

Remove -detachdb and stop's detach argument.
Merge branch 'http-improvements'

The base bits of pull req #1982.
Merge pull request #1943 from sipa/reindex2

Add -reindex, to perform in-place reindexing of block chain files
Fix tests after cache tweaks
allow listening on -bind=address for blocked networks

- this allows the client to listen on via -bind specified addresses
  (e.g. 127.0.0.1), even when a network (IPv4 in that case) was blocked
  via e.g -onlynet="Tor"
- introduce enum BindFlags to avoid passing multiple bools to Bind()
- make -bind help text clear we ALWAYS listen on the specified address
- remove an unused variable
- remove 2 unneeded IsLimited() checks before calling Bind(), which does
  these checks anyway

- usage case: specify -bind=127.0.0.1 -onlynet="Tor" to allow incoming
  connections to a Tor hidden service, but still don't allow other IPv4
  nodes to connect / get connected
Merge pull request #1778 from Diapolo/allow_explicit_bind

allow listening on -bind=address for blocked networks
simplify CDBEnv::Open() / fix small glitches

- remove pathEnv from CDBEnv, as this attribute is not needed
- change path parameter in ::Open() to a reference
- make nDbCache variable an unsigned integer
- remove a missplaced ";" behin ::IsMock()
Merge pull request #1993 from Diapolo/qt_header_cleanup

Qt: small header changes / fixes
Merge pull request #1977 from Diapolo/rem_printf_redef_rpc

remove printf redefinition from bitcoinrpc.cpp
fix some missing indentations in main.cpp for better readability
Merge pull request #1992 from Diapolo/no_memset

don't use memset() in privacy/security relevant code parts
Fix status text after reindex
One-line comments for public main functions