Compact serialization for variable-length integers

Variable-length integers: bytes are a MSB base-128 encoding of the number.
The high bit in each byte signifies whether another digit follows. To make
the encoding is one-to-one, one is subtracted from all but the last digit.
Thus, the byte sequence a[] with length len, where all but the last byte
has bit 128 set, encodes the number:

  (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))

  Properties:
  * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes)
  * Every integer has exactly one encoding
  * Encoding does not depend on size of original integer type
Basic classes for pruned version of transaction output list support

== CCoins: pruned list of transaction outputs ==

The CCoins class represents a pruned set of transaction outputs from
a given transaction. It only retains information about its height in
the block chain, whether it was a coinbase transaction, and its
unspent outputs (script + amount).

It has a custom serializer that has very low redundancy.

== Compact serialization for scripts ==

Special serializers for script which detect common cases and encode
them much more efficiently. 3 special cases are defined:
* Pay to pubkey hash (encoded as 21 bytes)
* Pay to script hash (encoded as 21 bytes)
* Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes)

Other scripts up to 121 bytes require 1 byte + script length. Above
that, scripts up to 16505 bytes require 2 bytes + script length.

== Compact serialization for amounts ==

Special serializer/deserializer for amount values. It is optimized for
values which have few non-zero digits in decimal representation. Most
amounts currently in the txout set take only 1 or 2 bytes to
represent.
Add CTxUndo: transaction undo information

The CTxUndo class encapsulates data necessary to undo the effects of
a transaction on the txout set, namely the previous outputs consumed
by it (script + amount), and potentially transaction meta-data when
it is spent entirely.
One file per block

Block database now stores one file per block.
Undo file creation

Create files with block undo information for the transactions in it.
Switch to CCoins & CCoinsView approach

This commit replaces old transactions index with unspent coins database
which contains a basic metadata like heights, amounts,
coinstake/coinbase flags and timestamps.

We still need access to blockchain for proof-of-stake blocks
validation. Current CheckProofOfStake() uses the coin database to
find the block height, and then scans that block to find the dependency
of coinstake kernel.
chmod 0755 leveldb/build_detect_platform
Update checkpoints
Batch block connection during initial block download

This reduces the load on the database engine, as subsequent blocks often
update an earlier block's transaction already.
Fix timestamp violation
Checkpoint fix
Add new LevelDB wrapper
Bugfix: don't resurrect coinstake transactions
UI fixes

* QT: sort transactions by date;
* RPC: repairwallet removes orphan related records from the wallet;
* Change currency symbol on coincontrol form, fix some typos.
Don't reaccept coinstakes
Add previous block checking in the proof-of-stake miner

This should help against orphans.
Bugfix: Get coinstake flag and timestamps from undo data
Don't create coins for empty coinbase transactions
Some proof-of-stake checkings refactoring

* Implement CBlock::CheckSignature() method for signatures and proofhash checking;
* Move PoW header signature checking to new CBlock::CheckLegacySignature() method;
* Remove some redundant messages from debug.log output;
* Make some DoS checkings harder.

Another changes:

* getblock and getblockbynumber RPC calls are now providing generator public key for proof-of-stake blocks.
Miner module fix