Cleaning up preferences-related code.
42 files changed