Preferences.
More preference work.
Merge branch 'prefs'
Add UI interface for test preferences.

Also add unit tests for those functions.