Implements OnSettingsUnloaded

Various settings handlers did stuff in their callbacks, but the callbacks were never called.

Fixes advancedsettings not clearing between profiles.

@Montellese to comment.