build: add -DMINIUPNP_STATICLIB for new version

libminiupnpc changed their required static define to the much more sane
"MINIUPNP_STATICLIB". Sadly, they don't respect the old "STATICLIB" for
back-compat. Define them both since the old one didn't seem to be conflicting
anywhere.

Also go ahead and split out the cppflags so that they can be applied only where
they're needed. This will help us to build dll's from our libs without having
their import/export declspecs poisoned.
depends: bump openssl to 1.0.1i

This is the forward-port of bba01750226745d6666d587cabe57c321fde0875.
depends: bump miniupnpc to 1.9.20140701.

This is the forward-port of a9c6eef915ee264ccf4169d5e8769a6be1fa101a
Perform CVerifyDB on pcoinsdbview instead of pcoinsTip

Bypassing the main coins cache allows more thorough checking with the same
memory budget.

This has no effect on performance because everything ends up in the child
cache created by VerifyDB itself.

It has bugged me ever since #4675, which effectively reduced the
number of checked blocks to reduce peak memory usage.

- Pass the coinsview to use as argument to VerifyDB

- This also avoids that the first `pcoinsTip->Flush()` after VerifyDB
  writes a large slew of unchanged coin records back to the database.
add missing header end comments

- ensures a consistent usage in header files
- also add a blank line after the copyright header where missing
- also remove orphan new-lines at the end of some files
add missing copyright headers
cleanup include of assert.h
rpc: Compute number of confirmations of a block from block height

Currently this uses a CMerkleTx, but that makes no sense as we
have the CBlockIndex available. As noted by @jgarzik.
Move CMerkleTx to wallet.cpp/h

It is only used by the wallet so it has no place in main.
missing include boost/algorithm/string/replace.hpp
Merge pull request #4788
Merge pull request #4778
Replace weird characters by normal spaces
Merge pull request #4781

187115c cleanup include of assert.h (Philip Kaufmann)
Merge pull request #4789

bac5586 Replace weird characters by normal spaces (Pieter Wuille)
changed field types in some structures to equivalent unambiguous types

Conflicts:
	src/core.cpp

Rebased-By: Wladimir J. van der Laan
Github-Pull: #4180
overhaul serialization code

The implementation of each class' serialization/deserialization is no longer
passed within a macro. The implementation now lies within a template of form:

template <typename T, typename Stream, typename Operation>
inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) {
    size_t nSerSize = 0;
    /* CODE */
    return nSerSize;
}

In cases when codepath should depend on whether or not we are just deserializing
(old fGetSize, fWrite, fRead flags) an additional clause can be used:
bool fRead = boost::is_same<Operation, CSerActionUnserialize>();

The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within
class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize,
Serialize and Unserialize. These are now wrappers around
the "SerializationOp" template.
remove fields of ser_streamplaceholder

The nType and nVersion fields of stream objects are never accessed
from outside the class (or perhaps from the inside too, I haven't checked).
Thus no need to have them in a placeholder, whose only purpose is to
fill the "Stream" template parameter in serialization implementation.
rework overhauled serialization methods to non-static

Thanks to Pieter Wuille for most of the work on this commit.
I did not fixup the overhaul commit, because a rebase conflicted
with "remove fields of ser_streamplaceholder".
I prefer not to risk making a mistake while resolving it.
Use CSizeComputer to avoid counting sizes in SerializationOp