CMessageHeader sanity changes

- Remove spurious `pchCommand[1] = 1` in CMessageHeader()
- Make sure that pchCommand is zero-padded if length is shorter than
  COMMAND_SIZE
- Use strnlen to determine length of pcmCommand in GetCommand
Do merkle root and txid duplicates check simultaneously

Move the txid duplicates check into BuildMerkleTree, where it can be done
much more efficiently (without needing to build a full txid set to detect
duplicates).

The previous version (using the std::set<uint256> to detect duplicates) was
also slightly too weak. A block mined with actual duplicate transactions
(which is invalid, due to the inputs of the duplicated transactions being
seen as double spends) would trigger the duplicates logic, resulting in the
block not being stored on disk, and rerequested. This change fixes that by
only triggering in the case of duplicated transactions that can actually
result in an identical merkle root.
minor variable init changes in init.cpp

- explicit init of pcoinsdbview and pwalletMain (even if not needed, as
  globals are init to NULL, it seems cleaner)
- remove check if (pwalletMain) in Shutdown() as delete is valid even if
  pwalletMain is NULL
Use a typedef for monetary values
doc: Add instructions for consistent Mac OS X build names
Switch testing framework from MAIN to new UNITTEST network

UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface
Suggested corrections on comments, variable names.
Also new test case testing the PoW skip in UNITTEST.
Avoid introducing a virtual into CChainParams

Treat fSkipProofOfWorkCheck the same as other parameters.
osx: fix signing to make Gatekeeper happy (again)

The approach from 65f3fa8d1 worked for signing on 10.9.4, but not newer
versions. 10.9.5 (and up) want each framework to stand alone.

Now in addition to copying the plist's from Qt for each framework, we put them
in per-version dirs and only symlink to the latest, rather than using symlinks
for any contents.
Fix formatting in  init.md
tests: fix python test-runner for windows

Windows needed a few fixups to get the tests running:
1. bitcoin-tx needs a file extension in Windows. Take this opportunity to
   add an env file, which pulls variables out of our build config. This can
   be extended as needed, for now it's very simple.
2. After #1, split the args out of the exec key in the test data.
3. Correct the line-endings from windows stdout
Update build-unix.md

Debian also need libboost-all-dev installed.
Merge pull request #5014

41d67c7 tests: fix python test-runner for windows (Cory Fields)
Merge pull request #5018

347a3a3 Update build-unix.md (JL2035)
Merge pull request #5005

af0bd5e osx: fix signing to make Gatekeeper happy (again) (Cory Fields)
Merge pull request #5008

41020eb Fix formatting in  init.md (Whit J)
remove dead/unused code in walletdb.cpp

- closes #5021
qt: Register CAmount metatype

This allows sending the type over queued connections.
Also normalize signal/slot names.
Merge pull request #4234

c122f55 qt: Register CAmount metatype (Wladimir J. van der Laan)
a372168 Use a typedef for monetary values (Mark Friedenbach)
doc: add make install to build-osx.md and build-unix.md