Added function to get total number of transactions in all blocks
Changes related to handle_block_to_main_chain

More old->new stuff, bit tedious to detail here, see comments.
Changes related to blockchain reorg

Changes documented in comments, too many to enumerate here.
Changes related to new block and alternate block validation

As before, see comments for details.
Updates to various utility / "getter" functions
Various style changes and comment updates