Improved detection of changed items when closing the settings for an app.
Refactored the tracking of initial/saved settings against the ones that are reflected by the current UI choices. Prevents false "changed" warnings, and eases maintenance and readibility.