For transaction::checkTransaction():
this in practice avoids lots of mallocs and overhead while doing
transaction checks.
For merkleroot, the same benefits. Avoiding copying and mallocs.
Merkle-block and merkle-tree classes and methods are pretty much stand-
alone and can be moved with no efforts.
Also move the relevent unit test to qtestlib.