optionDemultiplexer: Break up the switch in _setOption()

This also gets rid of the duplicate implementations in controlgroup, popup, and dialog.