Allow the use of synonyms in settings. Refactor settings.

Remove a bunch of obsolete/unused code.