Clean up rollback

This adds a checking macro that provides detailed error messages and makes a bunch of global variables and functions members of the RollbackManager.  It also removes some dead code, moves type definitions to the header file, and passes some large values by reference.
Rebased and duplicate `TOSTRING` removed.