NOTE: This is only the backend work necessary to load prefs. The actual separation of prefs into application/embedding will happen in another bug.