Added event handling for callbacks before and after the settings are saved.