Unload modules on cleanup; this allows capturing of serialized data so that it can be saved to the file if modules require it