Add generic on_exit support.
For scopes where we can't set the private data, create _sbbs.on_exit[] array and fill that with the scripts.
For scopes where we can't set the private data, create _sbbs.on_exit[] array and fill that with the scripts.
This will create a new commit in order to revert the existing changes.