changed CreateNewBlock to return a CBlockTemplate object, which includes per-tx fee and sigop count data
use fee/sigop data in BlockTemplate struct instead of (not always correctly) calculating it ourselves
Make DisconnectBlock fault-tolerant
Add checksums to undo data

This should be compatible with older code that didn't write checksums.
moved "index_in_template" to a separate variable to clarify what it is
New database check routine

-checklevel gets a new meaning:
0: verify blocks can be read from disk (like before)
1: verify (contextless) block validity (like before)
2: verify undo files can be read and have good checksums
3: verify coin database is consistent with the last few blocks
   (close to level 6 before)
4: verify all validity rules of the last few blocks

Level 3 is the new default, as it's reasonably fast. As level 3 and
4 are implemented using an in-memory rollback of the database, they
are limited to as many blocks as possible without exceeding the
limits set by -dbcache. The default of -dbcache=25 allows for some
150-200 blocks to be rolled back.

In case an error is found, the application quits with a message
instructing the user to restart with -reindex. Better instructions,
and automatic recovery (when possible) or automatic reindexing are
left as future work.
Merge pull request #2115 from forrestv/getblocktemplate_allfees

Provide fee data for all txs in RPC getblocktemplate response
Merge pull request #2145 from sipa/checkcoins

Coin database checks
small main.h cleanup (no code changes)

- removes some obsolete comments about CTransaction::FetchInputs(), a
  space and a few new-lines
Merge pull request #2169 from Diapolo/small_main_h_cleanup

small main.h cleanup (no code changes)