Attempt at enabling backup capability.
fix beginblock
remove use of blocks
fix state machine
missing db_go
missing db_get
remove debug