Environment#hook allows hooks to be run at arbitrary points
environment_unload hook