Final changes to make blockchain use BlockchainDB

Final actual code changes along with a few bug fixes and a ton of
compile error fixes.  But it builds!  Now to make the partial
implementation of BlockchainDB that people need to base full
implementations off of, and then testing!