fix bug where preferences seemed not to be saved

The problem was that widget ids were being used in place of
preference ids, which are very similar but not exactly the same.
This commit fixes the bug, but goes further and changes all the
widget ids to match the preference ids, reducing the chance of
confusion in the future.