small cleanup in src/compat .h and .cpp

- add license header
- fix include guards
- fix indentation
Add nLocalServices info to RPC getinfo

Also show full 64 bits of services. Previously service bits >32 that
were advertised just didn't show up at all.
Add comment regarding experimental-use service bits

As per mailing list discussion.
Merge pull request #4380

38405ac Add comment regarding experimental-use service bits (Peter Todd)
99ddc6c Add nLocalServices info to RPC getinfo (Peter Todd)
Add a built-in SHA256/SHA512 implementation.

This also moves the HMAC-SHA512 implementation to sha2.cpp.
Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.
Remove getwork() RPC call
Switch miner.cpp to use sha2 instead of OpenSSL.
Add built-in SHA-1 implementation.
Move crypto implementations to src/crypto/
Add built-in RIPEMD-160 implementation
Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible
Extend and move all crypto tests to crypto_tests.cpp
build: move bitcoin-config.h to its own directory

This allows us to include its path without making other header includes valid.
crypto: explicitly check for byte read/write functions

Don't depend on hard-coded platform lists
crypto: create a separate lib for crypto functions

This lib has no dependencies on other bitcoin functionality. Attempting to
use bitcoin headers will result in a failure to compile.
Add <Hasher>::OUTPUT_SIZE
Merge pull request #4379 from Diapolo/cleanup_compat

small cleanup in src/compat .h and .cpp
Merge pull request #4100

a0495bb Add <Hasher>::OUTPUT_SIZE (Pieter Wuille)
4791b99 crypto: create a separate lib for crypto functions (Cory Fields)
f2647cc crypto: explicitly check for byte read/write functions (Cory Fields)
5437248 build: move bitcoin-config.h to its own directory (Cory Fields)
3820e01 Extend and move all crypto tests to crypto_tests.cpp (Pieter Wuille)
7ecd973 Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible (Pieter Wuille)
a5bc9c0 Add built-in RIPEMD-160 implementation (Pieter Wuille)
13b5dfe Move crypto implementations to src/crypto/ (Pieter Wuille)
1cc344c Add built-in SHA-1 implementation. (Pieter Wuille)
85aab2a Switch miner.cpp to use sha2 instead of OpenSSL. (Pieter Wuille)
cf0c47b Remove getwork() RPC call (Pieter Wuille)
7b4737c Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL. (Pieter Wuille)
977cdad Add a built-in SHA256/SHA512 implementation. (Pieter Wuille)
Introduce whitelisted peers.

This adds a -whitelist option to specify subnet ranges from which peers
that connect are whitelisted. In addition, there is a -whitebind option
which works like -bind, except peers connecting to it are also
whitelisted (allowing a separate listen port for trusted connections).

Being whitelisted has two effects (for now):
* They are immune to DoS disconnection/banning.
* Transactions they broadcast (which are valid) are always relayed,
  even if they were already in the mempool. This means that a node
  can function as a gateway for a local network, and that rebroadcasts
  from the local network will work as expected.

Whitelisting replaces the magic exemption localhost had for DoS
disconnection (local addresses are still never banned, though), which
implied hidden service connects (from a localhost Tor node) were
incorrectly immune to DoS disconnection as well. This old
behaviour is removed for that reason, but can be restored using
-whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind
is safer to use in case non-trusted localhost connections are expected
(like hidden services).