Cleaning up preferences-related code.
39 files changed