Re-implemented support for default preferences specified in config.xml, and added functional tests to ensure it works.