New DB utilities pass the reorg test!

Major milestone!  Implemented the full test here:

https://bitcointalk.org/index.php?topic=46370.0

Successfully queried all address balances after the 3-block reorg.  This
means we're just about ready to start testing it on the full
blockchain.  Then we finally get to hook up the GUI to it.