Allow specifying dbtx in TxnBegin.

Optionally allow specifying an existing DbTxn to use in TxnBegin of the
DBs, so that one can use an atomic transaction across multiple databases
to fix syncing issues in the future.
Update support for reusing DbTxn's across DBs.

Implement better support for reusing database transactions to
synchronise multiple DBs with TxnBegin(parent-txn).  Keep track of which
transactions are our own, and only abort/commit those.
Fix handling of return value in TxnCommit/TxnAbort.

In the changes introduced to TxnCommit/TxnAbort due to ownTxn, the
return value was ignored so far due to an oversight.  Correct this.
Allow specifying dbtx in TxnBegin.

Optionally allow specifying an existing DbTxn to use in TxnBegin of the
DBs, so that one can use an atomic transaction across multiple databases
to fix syncing issues in the future.
Move CNameDB to db.h.

Move the CNameDB class to db.h and move the definition of vchType to
headers.  Fix the includes in other files so that everything compiles.
Add DatabaseSet wrapper class and use it.

Introduce a new class DatabaseSet that wraps around the "blockchain
status databases" CTxDB and CNameDB.  Use it instead of the classes
themselves for blockchain validation.  The only net effect this has is
that CNameDB is not created/destroyed in each Connect/DisconnectInputs
hook, but at the same time as the CTxDB.  It possibly also fixes syncing
between both with atomic transactions.
Properly create nameindex database when it not exists.

Ensure that the nameindex database is created before loading the block
index when it does not yet exist, otherwise using DatabaseSet fails.
Fix GameStepValidator's setting of fOwnDb.
Remove unused preqScript argument to SignSignature.

Remove an unused optional argument to the SignSignature functions to
simplify them.
Simplify SignSignature functions.

Simplify the two SignSignature functions by making one call the other
instead of duplicating the code.
Make argument const that can be.

Make a passed-by-ref argument that is never changed const to make this
explicit.
Unify signing of name and non-name inputs.

Unify the signing of name and non-name inputs in the code.  This also
makes signrawtransaction work for name-operation transactions.
Correctly set tx version in createrawtransaction.

If createrawtransaction is called with a name operation, correctly set
its nVersion as a namecoin tx.
Merge pull request #40 from domob1812/fix-signatures

Port signature-code simplifications and fixes from Namecoin
Merge pull request #41 from domob1812/db-updater

Port database class from Namecoin