[WIP] Refactoring in progress...
Removed test_userpref.py that cannot work easily with the refactored version.
More refactoring with utils.
Further refactoring with logging.
Further refactoring with the settings module.