Unloading JavaScript modules is now triggered before changing the DOM, not after, so that the modules can safely operate on DOM elements they reference.