Create a structured Preferences class.
Support /set_preferences on server side.
Support /set_preferences on client side.