Improving config

Big changes.  This basically restructures the Configuration system.

Originally the config system is globally, but it then has the problem that it cannot be modified for previewing the changes.  It is also intertwined with all the code.  This change separates the config system from the rendering part of the code, and also has the facilities for having a way of making changes to the config that aren't committed.

As a bonus the config now has ability to preview the changes before you make them on the preference page.