Settings refactor

This goes with the 'Settings refactor' PR in core. Please don't merge until that is also merged.