Shift preference updating into Preferences class.

Can then be re-used.