clear history when using clear button in RPC console

- current code does not clear history, when using the clear button, this
  is added
- remove a currently unused variable but add a TODO comment
tests for SetCompact and GetCompact of CBigNum
reimplement CBigNum's compact encoding of difficulty targets

Use shifts instead of going through the MPI representation of BIGNUMs.
Be careful to keep the meaning of 0x00800000 as sign bit.
Check for canonical public keys and signatures

Only enabled inside tests for now.
remove "checkorder" and "reply" P2P commands

These command are a leftover from send-to-IP transactions, which have been
removed a long time ago.
Also removes CNode::mapRequests and CNode::PushRequests, as these were
only used for the mentioned commands.
make optionsmodel query real proxy state for ::data()

- don't rely on the QSettings for cases ProxyUse and ProxySocksVersion and
  query the real values via the GetProxy() call
- add a missing "succesful =" for case ProxyUse in ::setData()
CAddrMan: verify pchMessageStart file marker, before reading address data

This avoids the case where you read the address data, before noticing it is
the wrong network.
Bitcoin-Qt: add new GCC compiler hardening options

- this patch enables several new GCC compiler hardening options that
  allows us to increase the security of our binaries (see:
  https://wiki.debian.org/Hardening)

-D_FORTIFY_SOURCE=2:
Enables compile-time protection against static sized buffer overflows.

-Wl,-z,relro -Wl,-z,now:
Enables full RELRO (RELocation Read-Only), which is a generic mitigation
technique to harden the data sections of an ELF binary/process. See:
http://isisblogs.poly.edu/2011/06/01/relro-relocation-read-only/ for
further details.
Bitcoin-Qt: remove unneeded "--param ssp-buffer-size=1" flag

- that flag is not needed when using "-fstack-protector-all", so remove it
  (see:
  http://stackoverflow.com/questions/1629685/when-and-how-to-use-gccs-stack-protection-feature)
Use CHashWriter also in SignatureHash(), and for message signing
Move external block import to separate thread
Merge pull request #1742 from sipa/canonical

Check for canonical public keys and signatures
Merge pull request #1880 from sipa/threadimport

Move external block import to separate thread
Import LevelDB 1.5, it will be used for the transaction database.
Leveldb Windows port by Edouard Alligand, adapted for MingW by me.
Disable libsnappy detection in LevelDB
Backport Win32 LevelDB env from C++0x to C++

Since the gitian mingw compiler doesn't support C++0x yet.
Makefile integration of LevelDB
LevelDB glue

Database-independent glue for supporting LevelDB databases.

Based on code from earlier commits by Mike Hearn in his leveldb
branch.
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