Clean up rollback

  * Adds a checking macro that provides detailed error messages.
  * Makes a bunch of global variables and functions members of the RollbackManager.
  * Removes some dead code.
  * Moves type definitions to the header file.
  * Passes some large values by reference.