Direct CCoins references

To prevent excessive copying of CCoins in and out of the CCoinsView
implementations, introduce a GetCoins() function in CCoinsViewCache
with returns a direct reference. The block validation and connection
logic is updated to require caching CCoinsViews, and exploits the
GetCoins() function heavily.
Automatically reorganize at startup to best known block

Given that the block tree database (chain.dat) and the active chain
database (coins.dat) are entirely separate now, it becomes legal to
swap one with another instance without affecting the other.

This commit introduces a check in the startup code that detects the
presence of a better chain in chain.dat that has not been activated
yet, and does so efficiently (in batch, while reusing the blk???.dat
files).
Prepare database format for multi-stage block processing

This commit adds a status field and a transaction counter to the block
indexes.
Use singleton block tree database instance
Flush and sync block data
LevelDB block and coin databases

Split off CBlockTreeDB and CCoinsViewDB into txdb-*.{cpp,h} files,
implemented by either LevelDB or BDB.

Based on code from earlier commits by Mike Hearn in his leveldb
branch.
Add LevelDB MemEnv support

Support LevelDB memory-backed environments, and use them in unit tests.
Add gettxout and gettxoutsetinfo RPCs
Remove BDB block database support
Merge pull request #1677 from sipa/ultraprune

Ultraprune: use a pruned-txout-set database for block validation
Merge pull request #1936 from sipa/morehashwriter

Use CHashWriter also in SignatureHash(), and for message signing
Merge pull request #1916 from jgarzik/caddrdb-bug

Fix: CAddrMan: verify pchMessageStart file marker, before reading address data
Update version numbers to 0.7.99
Merge pull request #1938 from sipa/v0799

Update version numbers to 0.7.99
Bugfix: do not mark all future coins spent
Tab instead of 4 spaces in makefile.mingw
Add NATIVE_WINDOWS

With a change of libs, and specifying NATIVE_WINDOWS as TARGET_OS it should compile libleveldb.a and libmemenv.a just fine, it did for me and Diapolo when testing.
remove init messages from ThreadImport()

- remove uiInterface.InitMessage() calls from ThreadImport(), as Qt
  doesn't like them getting called out of it's main thread and because the
  thread will continue to run after the GUI was loaded
Merge pull request #1941 from Diapolo/rem_initMsg_main

remove init messages from ThreadImport()
fix a double inclusion of txdb.h in bitcoin-qt.pro