Bug 1312355: Automatically convert Cu.import usage to two argument form. draft
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 24 Oct 2016 15:42:11 -0700
changeset 429826 c5e0a6244e08670efdc0751cae983a179e6dcbbf
parent 428972 b6571211c807e209e550833eb47dfc08a4c6ae53
child 535064 4cd7fab5a0553263280bbc9c7a05881b21aecba8
push id33671
push userdtownsend@mozilla.com
push dateWed, 26 Oct 2016 16:55:05 +0000
bugs1312355
milestone52.0a1
Bug 1312355: Automatically convert Cu.import usage to two argument form. MozReview-Commit-ID: 41s3x3S0Iv7
browser/base/content/aboutTabGroupsMigration.js
browser/base/content/aboutaccounts/aboutaccounts.js
browser/base/content/abouthealthreport/abouthealth.js
browser/base/content/browser-places.js
browser/base/content/browser-syncui.js
browser/base/content/browser.js
browser/base/content/content.js
browser/base/content/safeMode.js
browser/base/content/social-content.js
browser/base/content/sync/aboutSyncTabs.js
browser/base/content/sync/addDevice.js
browser/base/content/sync/setup.js
browser/base/content/tab-content.js
browser/base/content/test/general/browser_blob-channelname.js
browser/base/content/test/general/browser_fxa_oauth.js
browser/base/content/test/general/browser_fxa_web_channel.js
browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
browser/base/content/test/general/browser_sanitize-timespans.js
browser/base/content/test/general/browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js
browser/base/content/test/general/browser_web_channel.js
browser/base/content/test/general/parsingTestHelpers.jsm
browser/base/content/test/plugins/blocklist_proxy.js
browser/base/content/test/social/social_crash_content_helper.js
browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js
browser/base/content/webrtcIndicator.js
browser/components/contextualidentity/test/browser/browser_count_and_remove.js
browser/components/contextualidentity/test/browser/browser_favicon.js
browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/CustomizableWidgets.jsm
browser/components/customizableui/CustomizeMode.jsm
browser/components/customizableui/PanelWideWidgetTracker.jsm
browser/components/customizableui/ScrollbarSampler.jsm
browser/components/distribution.js
browser/components/downloads/DownloadsCommon.jsm
browser/components/downloads/DownloadsTaskbar.jsm
browser/components/downloads/DownloadsViewUI.jsm
browser/components/downloads/content/downloads.js
browser/components/downloads/test/browser/browser_confirm_unblock_download.js
browser/components/extensions/ext-browserAction.js
browser/components/extensions/ext-c-browserAction.js
browser/components/extensions/ext-c-pageAction.js
browser/components/extensions/ext-commands.js
browser/components/extensions/ext-contextMenus.js
browser/components/extensions/ext-history.js
browser/components/extensions/ext-pageAction.js
browser/components/extensions/ext-tabs.js
browser/components/extensions/ext-utils.js
browser/components/extensions/ext-windows.js
browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
browser/components/extensions/test/browser/browser_ext_tabs_events.js
browser/components/extensions/test/browser/browser_ext_windows_create_url.js
browser/components/feeds/FeedWriter.js
browser/components/feeds/test/unit/test_355473.js
browser/components/migration/360seProfileMigrator.js
browser/components/migration/AutoMigrate.jsm
browser/components/migration/ChromeProfileMigrator.js
browser/components/migration/ESEDBReader.jsm
browser/components/migration/EdgeProfileMigrator.js
browser/components/migration/FirefoxProfileMigrator.js
browser/components/migration/IEProfileMigrator.js
browser/components/migration/MSMigrationUtils.jsm
browser/components/migration/MigrationUtils.jsm
browser/components/migration/SafariProfileMigrator.js
browser/components/migration/content/migration.js
browser/components/migration/tests/unit/head_migration.js
browser/components/migration/tests/unit/test_Chrome_cookies.js
browser/components/migration/tests/unit/test_Chrome_passwords.js
browser/components/migration/tests/unit/test_Edge_db_migration.js
browser/components/migration/tests/unit/test_IE7_passwords.js
browser/components/migration/tests/unit/test_automigration.js
browser/components/newtab/NewTabMessages.jsm
browser/components/newtab/NewTabPrefsProvider.jsm
browser/components/newtab/NewTabSearchProvider.jsm
browser/components/newtab/NewTabURL.jsm
browser/components/newtab/NewTabWebChannel.jsm
browser/components/newtab/PlacesProvider.jsm
browser/components/newtab/PreviewProvider.jsm
browser/components/newtab/aboutNewTabService.js
browser/components/newtab/tests/browser/browser_PreviewProvider.js
browser/components/newtab/tests/browser/browser_newtab_overrides.js
browser/components/newtab/tests/browser/browser_newtabmessages.js
browser/components/newtab/tests/browser/browser_newtabwebchannel.js
browser/components/newtab/tests/browser/browser_remotenewtab_pageloads.js
browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js
browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js
browser/components/newtab/tests/xpcshell/test_NewTabURL.js
browser/components/newtab/tests/xpcshell/test_PlacesProvider.js
browser/components/nsBrowserGlue.js
browser/components/originattributes/test/browser/browser_favicon_firstParty.js
browser/components/places/PlacesUIUtils.jsm
browser/components/places/content/editBookmarkOverlay.js
browser/components/places/tests/browser/browser_bookmarksProperties.js
browser/components/places/tests/unit/head_bookmarks.js
browser/components/preferences/in-content/preferences.js
browser/components/preferences/in-content/tests/browser_advanced_update.js
browser/components/preferences/translation.js
browser/components/privatebrowsing/content/aboutPrivateBrowsing.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
browser/components/search/content/searchReset.js
browser/components/search/test/head.js
browser/components/selfsupport/SelfSupportService.js
browser/components/selfsupport/test/browser_selfsupportAPI.js
browser/components/sessionstore/PrivacyLevel.jsm
browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm
browser/components/sessionstore/SessionHistory.jsm
browser/components/sessionstore/SessionStorage.jsm
browser/components/sessionstore/content/aboutSessionRestore.js
browser/components/sessionstore/nsSessionStartup.js
browser/components/sessionstore/nsSessionStore.js
browser/components/sessionstore/test/browser_394759_basic.js
browser/components/sessionstore/test/browser_461634.js
browser/components/sessionstore/test/content.js
browser/components/shell/ShellService.jsm
browser/components/syncedtabs/SyncedTabsDeckComponent.js
browser/components/syncedtabs/TabListComponent.js
browser/components/syncedtabs/TabListView.js
browser/components/syncedtabs/sidebar.js
browser/components/syncedtabs/test/xpcshell/head.js
browser/components/tests/browser/browser_contentpermissionprompt.js
browser/components/translation/BingTranslator.jsm
browser/components/translation/Translation.jsm
browser/components/translation/TranslationContentHandler.jsm
browser/components/translation/TranslationDocument.jsm
browser/components/translation/YandexTranslator.jsm
browser/components/translation/cld2/cld-worker.js
browser/components/uitour/UITour.jsm
browser/components/uitour/test/head.js
browser/experiments/Experiments.jsm
browser/experiments/ExperimentsService.js
browser/experiments/test/addons/experiment-racybranch/bootstrap.js
browser/experiments/test/xpcshell/head.js
browser/experiments/test/xpcshell/test_activate.js
browser/experiments/test/xpcshell/test_api.js
browser/experiments/test/xpcshell/test_cache.js
browser/experiments/test/xpcshell/test_cacherace.js
browser/experiments/test/xpcshell/test_conditions.js
browser/experiments/test/xpcshell/test_disableExperiments.js
browser/experiments/test/xpcshell/test_fetch.js
browser/experiments/test/xpcshell/test_nethang_bug1012924.js
browser/experiments/test/xpcshell/test_previous_provider.js
browser/experiments/test/xpcshell/test_telemetry.js
browser/experiments/test/xpcshell/test_telemetry_disabled.js
browser/experiments/test/xpcshell/test_upgrade.js
browser/extensions/e10srollout/bootstrap.js
browser/extensions/flyweb/bootstrap.js
browser/extensions/formautofill/test/unit/head.js
browser/extensions/pdfjs/content/PdfJs.jsm
browser/extensions/pdfjs/content/PdfJsTelemetry.jsm
browser/extensions/pdfjs/content/PdfStreamConverter.jsm
browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm
browser/extensions/pdfjs/content/PdfjsContentUtils.jsm
browser/extensions/pocket/bootstrap.js
browser/extensions/pocket/content/AboutPocket.jsm
browser/extensions/pocket/content/Pocket.jsm
browser/extensions/pocket/content/main.js
browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
browser/extensions/pocket/content/pktApi.jsm
browser/extensions/pocket/content/pocket-content-process.js
browser/modules/AboutNewTab.jsm
browser/modules/AttributionCode.jsm
browser/modules/BrowserUITelemetry.jsm
browser/modules/BrowserUsageTelemetry.jsm
browser/modules/CaptivePortalWatcher.jsm
browser/modules/CastingApps.jsm
browser/modules/ContentClick.jsm
browser/modules/ContentCrashHandlers.jsm
browser/modules/ContentLinkHandler.jsm
browser/modules/ContentObservers.jsm
browser/modules/ContentSearch.jsm
browser/modules/ContentWebRTC.jsm
browser/modules/DirectoryLinksProvider.jsm
browser/modules/E10SUtils.jsm
browser/modules/FormSubmitObserver.jsm
browser/modules/HiddenFrame.jsm
browser/modules/LaterRun.jsm
browser/modules/PermissionUI.jsm
browser/modules/PluginContent.jsm
browser/modules/ProcessHangMonitor.jsm
browser/modules/ReaderParent.jsm
browser/modules/RecentWindow.jsm
browser/modules/RemotePrompt.jsm
browser/modules/SelfSupportBackend.jsm
browser/modules/Social.jsm
browser/modules/SocialService.jsm
browser/modules/TabGroupsMigrator.jsm
browser/modules/WindowsPreviewPerTab.jsm
browser/modules/test/browser_NetworkPrioritizer.js
browser/modules/test/browser_ProcessHangNotifications.js
browser/modules/test/head.js
browser/modules/test/unit/social/head.js
browser/modules/test/unit/social/test_SocialService.js
browser/modules/test/unit/social/test_SocialServiceMigration21.js
browser/modules/test/unit/social/test_SocialServiceMigration22.js
browser/modules/test/unit/social/test_SocialServiceMigration29.js
browser/modules/test/xpcshell/test_AttributionCode.js
browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
browser/modules/webrtcUI.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/CustomizeMode.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevTools.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/TabsInTitlebar.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Toolbars.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/WindowSize.jsm
toolkit/components/aboutmemory/content/aboutMemory.js
toolkit/components/addoncompat/CompatWarning.jsm
toolkit/components/addoncompat/Prefetcher.jsm
toolkit/components/addoncompat/RemoteAddonsChild.jsm
toolkit/components/addoncompat/RemoteAddonsParent.jsm
toolkit/components/addoncompat/defaultShims.js
toolkit/components/addoncompat/multiprocessShims.js
toolkit/components/addoncompat/tests/addon/bootstrap.js
toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
toolkit/components/alerts/resources/content/alert.js
toolkit/components/asyncshutdown/tests/xpcshell/head.js
toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js
toolkit/components/captivedetect/captivedetect.js
toolkit/components/captivedetect/test/unit/head_setprefs.js
toolkit/components/contentprefs/ContentPrefService2.jsm
toolkit/components/contentprefs/ContentPrefServiceChild.jsm
toolkit/components/contentprefs/ContentPrefUtils.jsm
toolkit/components/contentprefs/nsContentPrefService.js
toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
toolkit/components/contextualidentity/ContextualIdentityService.jsm
toolkit/components/contextualidentity/tests/unit/test_basic.js
toolkit/components/crashes/CrashManager.jsm
toolkit/components/crashmonitor/CrashMonitor.jsm
toolkit/components/downloads/test/unit/head_download_manager.js
toolkit/components/downloads/test/unit/test_app_rep.js
toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
toolkit/components/downloads/test/unit/test_app_rep_windows.js
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/ExtensionAPI.jsm
toolkit/components/extensions/ExtensionChild.jsm
toolkit/components/extensions/ExtensionContent.jsm
toolkit/components/extensions/ExtensionManagement.jsm
toolkit/components/extensions/ExtensionStorage.jsm
toolkit/components/extensions/ExtensionUtils.jsm
toolkit/components/extensions/LegacyExtensionsUtils.jsm
toolkit/components/extensions/MessageChannel.jsm
toolkit/components/extensions/NativeMessaging.jsm
toolkit/components/extensions/Schemas.jsm
toolkit/components/extensions/ext-alarms.js
toolkit/components/extensions/ext-backgroundPage.js
toolkit/components/extensions/ext-browser-content.js
toolkit/components/extensions/ext-cookies.js
toolkit/components/extensions/ext-downloads.js
toolkit/components/extensions/ext-i18n.js
toolkit/components/extensions/ext-idle.js
toolkit/components/extensions/ext-notifications.js
toolkit/components/extensions/ext-runtime.js
toolkit/components/extensions/ext-storage.js
toolkit/components/extensions/ext-webNavigation.js
toolkit/components/extensions/ext-webRequest.js
toolkit/components/extensions/test/xpcshell/test_csp_custom_policies.js
toolkit/components/extensions/test/xpcshell/test_ext_background_generated_load_events.js
toolkit/components/extensions/test/xpcshell/test_ext_background_global_history.js
toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js
toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
toolkit/components/extensions/test/xpcshell/test_ext_idle.js
toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_context.js
toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
toolkit/components/extensions/test/xpcshell/test_ext_schemas_async.js
toolkit/components/extensions/test/xpcshell/test_ext_topSites.js
toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
toolkit/components/extensions/test/xpcshell/test_locale_data.js
toolkit/components/extensions/test/xpcshell/test_native_messaging.js
toolkit/components/feeds/test/head.js
toolkit/components/formautofill/FormAutofill.jsm
toolkit/components/formautofill/FormAutofillContentService.js
toolkit/components/formautofill/FormAutofillIntegration.jsm
toolkit/components/formautofill/FormAutofillStartup.js
toolkit/components/formautofill/content/RequestAutocompleteUI.jsm
toolkit/components/formautofill/content/requestAutocomplete.js
toolkit/components/gfx/SanityTest.js
toolkit/components/jsdownloads/src/DownloadCore.jsm
toolkit/components/jsdownloads/src/DownloadImport.jsm
toolkit/components/jsdownloads/src/DownloadLegacy.js
toolkit/components/jsdownloads/src/DownloadList.jsm
toolkit/components/jsdownloads/src/DownloadStore.jsm
toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
toolkit/components/jsdownloads/src/Downloads.jsm
toolkit/components/jsdownloads/test/browser/head.js
toolkit/components/jsdownloads/test/unit/head.js
toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
toolkit/components/microformats/test/static/javascript/chai.js
toolkit/components/narrate/NarrateControls.jsm
toolkit/components/narrate/Narrator.jsm
toolkit/components/narrate/test/NarrateTestUtils.jsm
toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
toolkit/components/passwordmgr/LoginHelper.jsm
toolkit/components/passwordmgr/LoginImport.jsm
toolkit/components/passwordmgr/LoginManagerContent.jsm
toolkit/components/passwordmgr/LoginManagerContextMenu.jsm
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/passwordmgr/LoginRecipes.jsm
toolkit/components/passwordmgr/LoginStore.jsm
toolkit/components/passwordmgr/OSCrypto_win.js
toolkit/components/passwordmgr/content/passwordManager.js
toolkit/components/passwordmgr/nsLoginInfo.js
toolkit/components/passwordmgr/nsLoginManager.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
toolkit/components/passwordmgr/storage-json.js
toolkit/components/passwordmgr/test/LoginTestUtils.jsm
toolkit/components/passwordmgr/test/unit/head.js
toolkit/components/passwordmgr/test/unit/test_context_menu.js
toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js
toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js
toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js
toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js
toolkit/components/perfmonitoring/AddonWatcher.jsm
toolkit/components/places/BookmarkHTMLUtils.jsm
toolkit/components/places/BookmarkJSONUtils.jsm
toolkit/components/places/Bookmarks.jsm
toolkit/components/places/ColorAnalyzer.js
toolkit/components/places/History.jsm
toolkit/components/places/PageIconProtocolHandler.js
toolkit/components/places/PlacesBackups.jsm
toolkit/components/places/PlacesDBUtils.jsm
toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm
toolkit/components/places/PlacesSearchAutocompleteProvider.jsm
toolkit/components/places/PlacesSyncUtils.jsm
toolkit/components/places/PlacesUtils.jsm
toolkit/components/places/UnifiedComplete.js
toolkit/components/places/nsLivemarkService.js
toolkit/components/places/nsPlacesExpiration.js
toolkit/components/places/tests/PlacesTestUtils.jsm
toolkit/components/places/tests/bookmarks/head_bookmarks.js
toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js
toolkit/components/places/tests/browser/browser_colorAnalyzer.js
toolkit/components/places/tests/expiration/head_expiration.js
toolkit/components/places/tests/favicons/head_favicons.js
toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
toolkit/components/places/tests/head_common.js
toolkit/components/places/tests/history/head_history.js
toolkit/components/places/tests/history/test_insert.js
toolkit/components/places/tests/migration/head_migration.js
toolkit/components/places/tests/network/head_network.js
toolkit/components/places/tests/queries/head_queries.js
toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
toolkit/components/places/tests/unifiedcomplete/test_remotetabmatches.js
toolkit/components/places/tests/unit/head_bookmarks.js
toolkit/components/places/tests/unit/test_1105866.js
toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js
toolkit/components/places/tests/unit/test_async_in_batchmode.js
toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js
toolkit/components/places/tests/unit/test_bookmarks_json.js
toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
toolkit/components/places/tests/unit/test_keywords.js
toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
toolkit/components/places/tests/unit/test_sync_utils.js
toolkit/components/places/tests/unit/test_visitsInDB.js
toolkit/components/privatebrowsing/PrivateBrowsingTrackingProtectionWhitelist.js
toolkit/components/processsingleton/ContentProcessSingleton.js
toolkit/components/processsingleton/MainProcessSingleton.js
toolkit/components/prompts/content/commonDialog.js
toolkit/components/prompts/src/CommonDialog.jsm
toolkit/components/prompts/src/SharedPromptUtils.jsm
toolkit/components/prompts/src/nsPrompter.js
toolkit/components/reader/AboutReader.jsm
toolkit/components/reader/ReaderMode.jsm
toolkit/components/remotebrowserutils/RemoteWebNavigation.js
toolkit/components/satchel/AutoCompletePopup.jsm
toolkit/components/satchel/nsFormAutoComplete.js
toolkit/components/satchel/test/parent_utils.js
toolkit/components/satchel/test/unit/test_history_api.js
toolkit/components/search/SearchSuggestionController.jsm
toolkit/components/search/nsSearchSuggestions.js
toolkit/components/search/nsSidebar.js
toolkit/components/search/tests/xpcshell/head_search.js
toolkit/components/search/tests/xpcshell/test_searchSuggest.js
toolkit/components/telemetry/TelemetryController.jsm
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/TelemetrySend.jsm
toolkit/components/telemetry/TelemetrySession.jsm
toolkit/components/telemetry/TelemetryStorage.jsm
toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm
toolkit/components/telemetry/tests/unit/head.js
toolkit/components/telemetry/tests/unit/test_PingAPI.js
toolkit/components/telemetry/tests/unit/test_TelemetryController.js
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js
toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js
toolkit/components/terminator/nsTerminatorTelemetry.js
toolkit/components/thumbnails/BackgroundPageThumbs.jsm
toolkit/components/thumbnails/PageThumbUtils.jsm
toolkit/components/thumbnails/PageThumbsProtocol.js
toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js
toolkit/components/timermanager/tests/unit/consumerNotifications.js
toolkit/components/tooltiptext/TooltipTextProvider.js
toolkit/components/url-classifier/SafeBrowsing.jsm
toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
toolkit/components/url-classifier/tests/unit/test_digest256.js
toolkit/components/url-classifier/tests/unit/test_listmanager.js
toolkit/components/url-classifier/tests/unit/test_provider_url.js
toolkit/components/utils/simpleServices.js
toolkit/components/viewsource/ViewSourceBrowser.jsm
toolkit/components/viewsource/content/viewSource-content.js
toolkit/components/viewsource/content/viewSource.js
toolkit/components/viewsource/test/browser/head.js
toolkit/components/xulstore/XULStore.js
toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
toolkit/content/aboutNetworking.js
toolkit/content/aboutProfiles.js
toolkit/content/aboutServiceWorkers.js
toolkit/content/aboutSupport.js
toolkit/content/aboutTelemetry.js
toolkit/content/aboutwebrtc/aboutWebrtc.js
toolkit/content/browser-child.js
toolkit/content/browser-content.js
toolkit/content/process-content.js
toolkit/crashreporter/CrashSubmit.jsm
toolkit/crashreporter/content/crashes.js
toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
toolkit/identity/Identity.jsm
toolkit/identity/IdentityProvider.jsm
toolkit/identity/IdentityStore.jsm
toolkit/identity/IdentityUtils.jsm
toolkit/identity/LogUtils.jsm
toolkit/identity/MinimalIdentity.jsm
toolkit/identity/RelyingParty.jsm
toolkit/identity/Sandbox.jsm
toolkit/identity/jwcrypto.jsm
toolkit/identity/tests/unit/head_identity.js
toolkit/identity/tests/unit/test_firefox_accounts.js
toolkit/identity/tests/unit/test_identity_utils.js
toolkit/identity/tests/unit/test_log_utils.js
toolkit/identity/tests/unit/test_minimalidentity.js
toolkit/identity/tests/unit/test_provisioning.js
toolkit/identity/tests/unit/test_well-known.js
toolkit/modules/AsyncPrefs.jsm
toolkit/modules/BrowserUtils.jsm
toolkit/modules/CanonicalJSON.jsm
toolkit/modules/CharsetMenu.jsm
toolkit/modules/ClientID.jsm
toolkit/modules/Console.jsm
toolkit/modules/DateTimePickerHelper.jsm
toolkit/modules/DeferredTask.jsm
toolkit/modules/Deprecated.jsm
toolkit/modules/Finder.jsm
toolkit/modules/FinderHighlighter.jsm
toolkit/modules/FinderIterator.jsm
toolkit/modules/GMPInstallManager.jsm
toolkit/modules/GMPUtils.jsm
toolkit/modules/Integration.jsm
toolkit/modules/JSONFile.jsm
toolkit/modules/LightweightThemeConsumer.jsm
toolkit/modules/Locale.jsm
toolkit/modules/Log.jsm
toolkit/modules/Memory.jsm
toolkit/modules/NewTabUtils.jsm
toolkit/modules/PageMetadata.jsm
toolkit/modules/PermissionsUtils.jsm
toolkit/modules/PopupNotifications.jsm
toolkit/modules/Preferences.jsm
toolkit/modules/ProfileAge.jsm
toolkit/modules/PropertyListUtils.jsm
toolkit/modules/RemoteController.jsm
toolkit/modules/RemoteFinder.jsm
toolkit/modules/RemotePageManager.jsm
toolkit/modules/RemoteSecurityUI.jsm
toolkit/modules/RemoteWebProgress.jsm
toolkit/modules/ResetProfile.jsm
toolkit/modules/SelectContentHelper.jsm
toolkit/modules/SessionRecorder.jsm
toolkit/modules/ShortcutUtils.jsm
toolkit/modules/Sqlite.jsm
toolkit/modules/Task.jsm
toolkit/modules/Troubleshoot.jsm
toolkit/modules/UpdateUtils.jsm
toolkit/modules/WebChannel.jsm
toolkit/modules/ZipUtils.jsm
toolkit/modules/addons/MatchPattern.jsm
toolkit/modules/addons/WebNavigation.jsm
toolkit/modules/addons/WebRequest.jsm
toolkit/modules/addons/WebRequestContent.js
toolkit/modules/addons/WebRequestUpload.jsm
toolkit/modules/secondscreen/PresentationApp.jsm
toolkit/modules/secondscreen/RokuApp.jsm
toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
toolkit/modules/sessionstore/FormData.jsm
toolkit/modules/subprocess/Subprocess.jsm
toolkit/modules/subprocess/subprocess_common.jsm
toolkit/modules/subprocess/subprocess_unix.jsm
toolkit/modules/subprocess/subprocess_win.jsm
toolkit/modules/subprocess/test/xpcshell/head.js
toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
toolkit/modules/tests/xpcshell/TestIntegration.jsm
toolkit/modules/tests/xpcshell/test_DeferredTask.js
toolkit/modules/tests/xpcshell/test_FinderIterator.js
toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
toolkit/modules/tests/xpcshell/test_Integration.js
toolkit/modules/tests/xpcshell/test_JSONFile.js
toolkit/modules/tests/xpcshell/test_Log.js
toolkit/modules/tests/xpcshell/test_NewTabUtils.js
toolkit/modules/tests/xpcshell/test_Preferences.js
toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
toolkit/modules/tests/xpcshell/test_client_id.js
toolkit/modules/tests/xpcshell/test_session_recorder.js
toolkit/modules/tests/xpcshell/test_sqlite.js
toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
toolkit/modules/tests/xpcshell/test_web_channel.js
toolkit/modules/tests/xpcshell/test_web_channel_broker.js
toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
toolkit/mozapps/downloads/DownloadUtils.jsm
toolkit/mozapps/downloads/content/downloads.js
toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/ChromeManifestParser.jsm
toolkit/mozapps/extensions/DeferredSave.jsm
toolkit/mozapps/extensions/addonManager.js
toolkit/mozapps/extensions/amInstallTrigger.js
toolkit/mozapps/extensions/amWebAPI.js
toolkit/mozapps/extensions/amWebInstallListener.js
toolkit/mozapps/extensions/content/about.js
toolkit/mozapps/extensions/content/eula.js
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/newaddon.js
toolkit/mozapps/extensions/internal/AddonRepository.jsm
toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/internal/E10SAddonsRollout.jsm
toolkit/mozapps/extensions/internal/GMPProvider.jsm
toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
toolkit/mozapps/extensions/internal/PluginProvider.jsm
toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/internal/XPIProviderUtils.js
toolkit/mozapps/extensions/test/AddonManagerTesting.jsm
toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
toolkit/mozapps/extensions/test/xpcshell/test_install.js
toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_metadata_update.js
toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js
toolkit/mozapps/handling/content/dialog.js
toolkit/mozapps/installer/precompile_cache.js
toolkit/mozapps/update/tests/data/shared.js
toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
--- a/browser/base/content/aboutTabGroupsMigration.js
+++ b/browser/base/content/aboutTabGroupsMigration.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 
-Cu.import("resource:///modules/TabGroupsMigrator.jsm");
+let { TabGroupsMigrator } = Cu.import("resource:///modules/TabGroupsMigrator.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 const SUPPORT_URL = "https://support.mozilla.org/kb/tab-groups-removal";
 
 function createLink() {
   let link = document.getElementById("sumolink");
   link.href = SUPPORT_URL;
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -1,24 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FxAccounts.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { fxAccounts } = Cu.import("resource://gre/modules/FxAccounts.jsm", {});
 
 var fxAccountsCommon = {};
 Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
 
-// for master-password utilities
-Cu.import("resource://services-sync/util.js");
+let { XPCOMUtils, Services, Utils } = Cu.import("resource://services-sync/util.js", {});
 
 const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
 const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog";
 
 const ACTION_URL_PARAM = "action";
 
 const OBSERVER_TOPICS = [
   fxAccountsCommon.ONVERIFIED_NOTIFICATION,
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const prefs = new Preferences("datareporting.healthreport.");
 
 const PREF_UNIFIED = "toolkit.telemetry.unified";
 const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
 
 var healthReportWrapper = {
   init: function () {
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -435,17 +435,17 @@ var PlacesCommandHook = {
   // TODO: Replace bookmarkPage code with this function once legacy
   // transactions are removed.
   _bookmarkPagePT: Task.async(function* (aBrowser, aParentId, aShowEditUI) {
     let url = new URL(aBrowser.currentURI.spec);
     let info = yield PlacesUtils.bookmarks.fetch({ url });
     let isNewBookmark = !info;
     if (!info) {
       let parentGuid = aParentId !== undefined ?
-                         yield PlacesUtils.promiseItemGuid(aParentId) :
+                         (yield PlacesUtils.promiseItemGuid(aParentId)) :
                          PlacesUtils.bookmarks.unfiledGuid;
       info = { url, parentGuid };
       // Bug 1148838 - Make this code work for full page plugins.
       let description = null;
       let charset = null;
 
       let docInfo = yield this._getPageDetails(aBrowser);
 
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 if (AppConstants.MOZ_SERVICES_CLOUDSYNC) {
   XPCOMUtils.defineLazyModuleGetter(this, "CloudSync",
                                     "resource://gre/modules/CloudSync.jsm");
 }
 
 XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
                                   "resource://gre/modules/FxAccounts.jsm");
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2,18 +2,18 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cc = Components.classes;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { ContextualIdentityService } = Cu.import("resource://gre/modules/ContextualIdentityService.jsm", {});
 Cu.import("resource://gre/modules/NotificationDB.jsm");
 
 // lazy module getters
 [
   ["AboutHome", "resource:///modules/AboutHome.jsm"],
   ["AddonWatcher", "resource://gre/modules/AddonWatcher.jsm"],
   ["AppConstants", "resource://gre/modules/AppConstants.jsm"],
   ["BrowserUITelemetry", "resource:///modules/BrowserUITelemetry.jsm"],
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -3,23 +3,23 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* This content script should work in any browser or iframe and should not
  * depend on the frame being contained in tabbrowser. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/ContentWebRTC.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { ContentWebRTC } = Cu.import("resource:///modules/ContentWebRTC.jsm", {});
 Cu.import("resource:///modules/ContentObservers.jsm");
-Cu.import("resource://gre/modules/InlineSpellChecker.jsm");
-Cu.import("resource://gre/modules/InlineSpellCheckerContent.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { SpellCheckHelper } = Cu.import("resource://gre/modules/InlineSpellChecker.jsm", {});
+let { InlineSpellCheckerContent } = Cu.import("resource://gre/modules/InlineSpellCheckerContent.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
   "resource:///modules/E10SUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ContentLinkHandler",
   "resource:///modules/ContentLinkHandler.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
--- a/browser/base/content/safeMode.js
+++ b/browser/base/content/safeMode.js
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 const appStartup = Services.startup;
 
-Cu.import("resource://gre/modules/ResetProfile.jsm");
+let { ResetProfile } = Cu.import("resource://gre/modules/ResetProfile.jsm", {});
 
 var defaultToReset = false;
 
 function restartApp() {
   appStartup.quit(appStartup.eForceQuit | appStartup.eRestart);
 }
 
 function resetProfile() {
--- a/browser/base/content/social-content.js
+++ b/browser/base/content/social-content.js
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* This content script is intended for use by iframes in the share panel. */
 
 var {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 // social frames are always treated as app tabs
 docShell.isAppTab = true;
 
 addEventListener("DOMContentLoaded", function(event) {
   if (event.target != content.document)
     return;
--- a/browser/base/content/sync/aboutSyncTabs.js
+++ b/browser/base/content/sync/aboutSyncTabs.js
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cu = Components.utils;
 
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://services-sync/main.js");
-Cu.import("resource:///modules/PlacesUIUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Weave } = Cu.import("resource://services-sync/main.js", {});
+let { PlacesUIUtils } = Cu.import("resource:///modules/PlacesUIUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 Cu.import("resource://gre/modules/PlacesUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
 if (AppConstants.MOZ_SERVICES_CLOUDSYNC) {
   XPCOMUtils.defineLazyModuleGetter(this, "CloudSync",
                                     "resource://gre/modules/CloudSync.jsm");
 }
--- a/browser/base/content/sync/addDevice.js
+++ b/browser/base/content/sync/addDevice.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cu = Components.utils;
 
-Cu.import("resource://services-sync/main.js");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Weave } = Cu.import("resource://services-sync/main.js", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const PIN_PART_LENGTH = 4;
 
 const ADD_DEVICE_PAGE       = 0;
 const SYNC_KEY_PAGE         = 1;
 const DEVICE_CONNECTED_PAGE = 2;
 
 var gSyncAddDevice = {
--- a/browser/base/content/sync/setup.js
+++ b/browser/base/content/sync/setup.js
@@ -20,21 +20,21 @@ const OPTIONS_CONFIRM_PAGE          = 6;
 
 // Broader than we'd like, but after this changed from api-secure.recaptcha.net
 // we had no choice. At least we only do this for the duration of setup.
 // See discussion in Bugs 508112 and 653307.
 const RECAPTCHA_DOMAIN = "https://www.google.com";
 
 const PIN_PART_LENGTH = 4;
 
-Cu.import("resource://services-sync/main.js");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/PluralForm.jsm");
+let { Weave } = Cu.import("resource://services-sync/main.js", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { PluralForm } = Cu.import("resource://gre/modules/PluralForm.jsm", {});
 
 
 function setVisibility(element, visible) {
   element.style.visibility = visible ? "visible" : "hidden";
 }
 
 var gSyncSetup = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -2,19 +2,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* This content script contains code that requires a tab browser. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ExtensionContent.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { ExtensionContent } = Cu.import("resource://gre/modules/ExtensionContent.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
   "resource:///modules/E10SUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AboutReader",
--- a/browser/base/content/test/general/browser_blob-channelname.js
+++ b/browser/base/content/test/general/browser_blob-channelname.js
@@ -1,11 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 function test() {
     var file = new File([new Blob(['test'], {type: 'text/plain'})], "test-name");
     var url = URL.createObjectURL(file);
     var channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
 
     is(channel.contentDispositionFilename, 'test-name', "filename matches");
 }
--- a/browser/base/content/test/general/browser_fxa_oauth.js
+++ b/browser/base/content/test/general/browser_fxa_oauth.js
@@ -4,18 +4,18 @@
 
 ///////////////////
 //
 // Whitelisting this test.
 // As part of bug 1077403, the leaking uncaught rejection should be fixed.
 //
 thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.docShell is null");
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsOAuthClient",
   "resource://gre/modules/FxAccountsOAuthClient.jsm");
 
 const HTTP_PATH = "http://example.com";
 const HTTP_ENDPOINT = "/browser/browser/base/content/test/general/browser_fxa_oauth.html";
 const HTTP_ENDPOINT_WITH_KEYS = "/browser/browser/base/content/test/general/browser_fxa_oauth_with_keys.html";
 
--- a/browser/base/content/test/general/browser_fxa_web_channel.js
+++ b/browser/base/content/test/general/browser_fxa_web_channel.js
@@ -1,14 +1,10 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
   return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
                                   "resource://gre/modules/WebChannel.jsm");
 
--- a/browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
+++ b/browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 function makeInputStream(aString) {
   let stream = Cc["@mozilla.org/io/string-input-stream;1"]
                  .createInstance(Ci.nsIStringInputStream);
   stream.data = aString;
   return stream; // XPConnect will QI this to nsIInputStream for us.
 }
 
--- a/browser/base/content/test/general/browser_sanitize-timespans.js
+++ b/browser/base/content/test/general/browser_sanitize-timespans.js
@@ -1,10 +1,10 @@
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 requestLongerTimeout(2);
 
 // Bug 453440 - Test the timespan-based logic of the sanitizer code
 var now_mSec = Date.now();
 var now_uSec = now_mSec * 1000;
 
 const kMsecPerMin = 60 * 1000;
--- a/browser/base/content/test/general/browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js
+++ b/browser/base/content/test/general/browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const OPEN_LOCATION_PREF = "browser.link.open_newwindow";
 const NON_REMOTE_PAGE = "about:welcomeback";
 
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
 
 requestLongerTimeout(2);
 
 function frame_script() {
   content.document.body.innerHTML = `
     <a href="about:home" target="_blank" id="testAnchor">Open a window</a>
   `;
 
--- a/browser/base/content/test/general/browser_web_channel.js
+++ b/browser/base/content/test/general/browser_web_channel.js
@@ -1,15 +1,11 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
   "resource://gre/modules/WebChannel.jsm");
 
 const HTTP_PATH = "http://example.com";
 const HTTP_ENDPOINT = "/browser/browser/base/content/test/general/browser_web_channel.html";
 const HTTP_MISMATCH_PATH = "http://example.org";
 const HTTP_IFRAME_PATH = "http://mochi.test:8888";
 const HTTP_REDIRECTED_IFRAME_PATH = "http://example.org";
--- a/browser/base/content/test/general/parsingTestHelpers.jsm
+++ b/browser/base/content/test/general/parsingTestHelpers.jsm
@@ -7,19 +7,19 @@ this.EXPORTED_SYMBOLS = ["generateURIsFr
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 /* Shorthand constructors to construct an nsI(Local)File and zip reader: */
 const LocalFile = new Components.Constructor("@mozilla.org/file/local;1", Ci.nsIFile, "initWithPath");
 const ZipReader = new Components.Constructor("@mozilla.org/libjar/zip-reader;1", "nsIZipReader", "open");
 
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 
 /**
  * Returns a promise that is resolved with a list of files that have one of the
  * extensions passed, represented by their nsIURI objects, which exist inside
  * the directory passed.
  *
  * @param dir the directory which to scan for files (nsIFile)
--- a/browser/base/content/test/plugins/blocklist_proxy.js
+++ b/browser/base/content/test/plugins/blocklist_proxy.js
@@ -2,17 +2,17 @@ var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cm = Components.manager;
 
 const kBlocklistServiceUUID = "{66354bc9-7ed1-4692-ae1d-8da97d6b205e}";
 const kBlocklistServiceContractID = "@mozilla.org/extensions/blocklist;1";
 const kBlocklistServiceFactory = Cm.getClassObject(Cc[kBlocklistServiceContractID], Ci.nsIFactory);
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
 
 /*
  * A lightweight blocklist proxy for the testing purposes.
  */
 var BlocklistProxy = {
   _uuid: null,
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
--- a/browser/base/content/test/social/social_crash_content_helper.js
+++ b/browser/base/content/test/social/social_crash_content_helper.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var Cu = Components.utils;
 
-// Ideally we would use CrashTestUtils.jsm, but that's only available for
-// xpcshell tests - so we just copy a ctypes crasher from it.
-Cu.import("resource://gre/modules/ctypes.jsm");
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
 var crash = function() { // this will crash when called.
   let zero = new ctypes.intptr_t(8);
   let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
   badptr.contents
 };
 
 
 var TestHelper = {
--- a/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js
+++ b/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js
@@ -1,11 +1,11 @@
 "use strict";
 
-Cu.import("resource:///modules/BrowserUITelemetry.jsm");
+let { BrowserUITelemetry } = Cu.import("resource:///modules/BrowserUITelemetry.jsm", {});
 
 const SUGGEST_URLBAR_PREF = "browser.urlbar.suggest.searches";
 const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml";
 
 // Must run first.
 add_task(function* prepare() {
   Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, true);
   let engine = yield promiseNewSearchEngine(TEST_ENGINE_BASENAME);
--- a/browser/base/content/webrtcIndicator.js
+++ b/browser/base/content/webrtcIndicator.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/webrtcUI.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { webrtcUI } = Cu.import("resource:///modules/webrtcUI.jsm", {});
 
 const BUNDLE_URL = "chrome://browser/locale/webrtcIndicator.properties";
 var gStringBundle;
 
 function init(event) {
   gStringBundle = Services.strings.createBundle(BUNDLE_URL);
 
   let brand = Services.strings.createBundle("chrome://branding/locale/brand.properties");
--- a/browser/components/contextualidentity/test/browser/browser_count_and_remove.js
+++ b/browser/components/contextualidentity/test/browser/browser_count_and_remove.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
+let { ContextualIdentityService } = Cu.import("resource://gre/modules/ContextualIdentityService.jsm", {});
 
 function openTabInUserContext(userContextId) {
   let tab = gBrowser.addTab("about:blank", {userContextId});
   gBrowser.selectedTab = tab;
 }
 
 add_task(function* setup() {
   // make sure userContext is enabled.
--- a/browser/components/contextualidentity/test/browser/browser_favicon.js
+++ b/browser/components/contextualidentity/test/browser/browser_favicon.js
@@ -1,15 +1,15 @@
 /*
  * Bug 1270678 - A test case to test does the favicon obey originAttributes.
  */
 let { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {});
 
 const USER_CONTEXTS = [
   "default",
   "personal",
   "work",
 ];
 
--- a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
@@ -1,16 +1,16 @@
 /*
  * Bug 1238183 - Test cases for forgetAboutSite with userContextId.
  */
 
 const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ForgetAboutSite } = Cu.import("resource://gre/modules/ForgetAboutSite.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {});
 let LoadContextInfo = Cc["@mozilla.org/load-context-info-factory;1"]
                       .getService(Ci.nsILoadContextInfoFactory);
 let css = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
            .getService(Ci.nsICacheStorageService);
 
 const USER_CONTEXTS = [
   "default",
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -3,19 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["CustomizableUI"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PanelWideWidgetTracker",
   "resource:///modules/PanelWideWidgetTracker.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableWidgets",
   "resource:///modules/CustomizableWidgets.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -2,20 +2,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 this.EXPORTED_SYMBOLS = ["CustomizableWidgets"];
 
-Cu.import("resource:///modules/CustomizableUI.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { CustomizableUI } = Cu.import("resource:///modules/CustomizableUI.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
   "resource:///modules/BrowserUITelemetry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
   "resource:///modules/PlacesUIUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentlyClosedTabsAndWindowsMenuUtils",
   "resource:///modules/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm");
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -16,23 +16,23 @@ const kPlaceholderClass = "panel-customi
 const kSkipSourceNodePref = "browser.uiCustomization.skipSourceNodeCheck";
 const kToolbarVisibilityBtn = "customization-toolbar-visibility-button";
 const kDrawInTitlebarPref = "browser.tabs.drawInTitlebar";
 const kMaxTransitionDurationMs = 2000;
 
 const kPanelItemContextMenu = "customizationPanelItemContextMenu";
 const kPaletteItemContextMenu = "customizationPaletteItemContextMenu";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/CustomizableUI.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { CustomizableUI } = Cu.import("resource:///modules/CustomizableUI.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DragPositionManager",
                                   "resource:///modules/DragPositionManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
                                   "resource:///modules/BrowserUITelemetry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
--- a/browser/components/customizableui/PanelWideWidgetTracker.jsm
+++ b/browser/components/customizableui/PanelWideWidgetTracker.jsm
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 this.EXPORTED_SYMBOLS = ["PanelWideWidgetTracker"];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 
 var gPanel = CustomizableUI.AREA_PANEL;
 // We keep track of the widget placements for the panel locally:
 var gPanelPlacements = [];
 
 // All the wide widgets we know of:
--- a/browser/components/customizableui/ScrollbarSampler.jsm
+++ b/browser/components/customizableui/ScrollbarSampler.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ScrollbarSampler"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var gSystemScrollbarWidth = null;
 
 this.ScrollbarSampler = {
   getSystemScrollbarWidth: function() {
     if (gSystemScrollbarWidth !== null) {
       return Promise.resolve(gSystemScrollbarWidth);
--- a/browser/components/distribution.js
+++ b/browser/components/distribution.js
@@ -7,20 +7,20 @@ this.EXPORTED_SYMBOLS = [ "DistributionC
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
 const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC =
   "distribution-customization-complete";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 
 this.DistributionCustomizer = function DistributionCustomizer() {
   // For parallel xpcshell testing purposes allow loading the distribution.ini
   // file from the profile folder through an hidden pref.
   let loadFromProfile = false;
   try {
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -30,18 +30,18 @@ this.EXPORTED_SYMBOLS = [
  * the registered download status indicators.
  */
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadUIHelper",
--- a/browser/components/downloads/DownloadsTaskbar.jsm
+++ b/browser/components/downloads/DownloadsTaskbar.jsm
@@ -17,17 +17,17 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
                                   "resource:///modules/RecentWindow.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
--- a/browser/components/downloads/DownloadsViewUI.jsm
+++ b/browser/components/downloads/DownloadsViewUI.jsm
@@ -10,17 +10,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "DownloadsViewUI",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils",
                                   "resource://gre/modules/DownloadUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
                                   "resource:///modules/DownloadsCommon.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
--- a/browser/components/downloads/content/downloads.js
+++ b/browser/components/downloads/content/downloads.js
@@ -58,17 +58,17 @@
  * us to draw a ring around the currently focused element. If the panel is
  * closed or the mouse moves over the panel, we remove the attribute.
  */
 
 "use strict";
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
                                   "resource:///modules/DownloadsCommon.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadsViewUI",
                                   "resource:///modules/DownloadsViewUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
--- a/browser/components/downloads/test/browser/browser_confirm_unblock_download.js
+++ b/browser/components/downloads/test/browser/browser_confirm_unblock_download.js
@@ -4,17 +4,17 @@
 "use strict";
 
 // Tests the dialog which allows the user to unblock a downloaded file.
 
 registerCleanupFunction(() => {});
 
 function* assertDialogResult({ args, buttonToClick, expectedResult }) {
   promiseAlertDialogOpen(buttonToClick);
-  is(yield DownloadsCommon.confirmUnblockDownload(args), expectedResult);
+  is((yield DownloadsCommon.confirmUnblockDownload(args)), expectedResult);
 }
 
 /**
  * Tests the "unblock" dialog, for each of the possible verdicts.
  */
 add_task(function* test_unblock_dialog_unblock() {
   for (let verdict of [Downloads.Error.BLOCK_VERDICT_MALWARE,
                        Downloads.Error.BLOCK_VERDICT_POTENTIALLY_UNWANTED,
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -8,19 +8,19 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
                                   "resource://gre/modules/Timer.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "colorUtils", () => {
   return require("devtools/shared/css/color").colorUtils;
 });
 
-Cu.import("resource://devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { EventEmitter } = Cu.import("resource://devtools/shared/event-emitter.js", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 var {
   EventManager,
   IconDetails,
 } = ExtensionUtils;
 
 const POPUP_PRELOAD_TIMEOUT_MS = 200;
 
--- a/browser/components/extensions/ext-c-browserAction.js
+++ b/browser/components/extensions/ext-c-browserAction.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   IconDetails,
 } = ExtensionUtils;
 
 extensions.registerSchemaAPI("browserAction", "addon_child", context => {
   return {
     browserAction: {
       setIcon: function(details) {
--- a/browser/components/extensions/ext-c-pageAction.js
+++ b/browser/components/extensions/ext-c-pageAction.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   IconDetails,
 } = ExtensionUtils;
 
 extensions.registerSchemaAPI("pageAction", "addon_child", context => {
   return {
     pageAction: {
       setIcon: function(details) {
--- a/browser/components/extensions/ext-commands.js
+++ b/browser/components/extensions/ext-commands.js
@@ -1,14 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { EventEmitter } = Cu.import("resource://devtools/shared/event-emitter.js", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 var {
   EventManager,
   PlatformInfo,
 } = ExtensionUtils;
 
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
--- a/browser/components/extensions/ext-contextMenus.js
+++ b/browser/components/extensions/ext-contextMenus.js
@@ -1,15 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/MatchPattern.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
+let { MatchPattern } = Cu.import("resource://gre/modules/MatchPattern.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var {
   EventManager,
   IconDetails,
 } = ExtensionUtils;
 
 // Map[Extension -> Map[ID -> MenuItem]]
--- a/browser/components/extensions/ext-history.js
+++ b/browser/components/extensions/ext-history.js
@@ -1,15 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
                                   "resource://devtools/shared/event-emitter.js");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 
--- a/browser/components/extensions/ext-pageAction.js
+++ b/browser/components/extensions/ext-pageAction.js
@@ -1,14 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   EventManager,
   IconDetails,
 } = ExtensionUtils;
 
 // WeakMap[Extension -> PageAction]
 var pageActionMap = new WeakMap();
 
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -8,17 +8,17 @@ XPCOMUtils.defineLazyServiceGetter(this,
 
 XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
                                   "resource://gre/modules/MatchPattern.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
                                   "resource://gre/modules/PromiseUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 var {
   EventManager,
   ignoreEvent,
 } = ExtensionUtils;
 
 // This function is pretty tightly tied to Extension.jsm.
 // Its job is to fill in the |tab| property of the sender.
--- a/browser/components/extensions/ext-utils.js
+++ b/browser/components/extensions/ext-utils.js
@@ -16,18 +16,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
                                    "@mozilla.org/content/style-sheet-service;1",
                                    "nsIStyleSheetService");
 
 XPCOMUtils.defineLazyGetter(this, "colorUtils", () => {
   return require("devtools/shared/css/color").colorUtils;
 });
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const POPUP_LOAD_TIMEOUT_MS = 200;
 
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 var {
   DefaultWeakMap,
   EventManager,
--- a/browser/components/extensions/ext-windows.js
+++ b/browser/components/extensions/ext-windows.js
@@ -5,17 +5,17 @@
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
                                   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   EventManager,
   promiseObserved,
 } = ExtensionUtils;
 
 function onXULFrameLoaderCreated({target}) {
   target.messageManager.sendAsyncMessage("AllowScriptsToClose", {});
 }
--- a/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
+++ b/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 add_task(function* test_user_defined_commands() {
   const testCommands = [
     // Ctrl Shortcuts
     {
       name: "toggle-ctrl-a",
       shortcut: "Ctrl+A",
       key: "A",
--- a/browser/components/extensions/test/browser/browser_ext_tabs_events.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_events.js
@@ -216,23 +216,23 @@ add_task(function* testTabEventsSize() {
 
   for (let resolution of [2, 1]) {
     SpecialPowers.setCharPref(RESOLUTION_PREF, String(resolution));
     is(window.devicePixelRatio, resolution, "window has the required resolution");
 
     extension.sendMessage("create-tab");
     let tabId = yield extension.awaitMessage("created-tab-id");
 
-    checkDimensions(yield extension.awaitMessage("create-dims"), "create");
-    checkDimensions(yield extension.awaitMessage("on-created-dims"), "onCreated");
+    checkDimensions((yield extension.awaitMessage("create-dims")), "create");
+    checkDimensions((yield extension.awaitMessage("on-created-dims")), "onCreated");
 
     extension.sendMessage("update-tab", tabId);
 
-    checkDimensions(yield extension.awaitMessage("update-dims"), "update");
-    checkDimensions(yield extension.awaitMessage("on-updated-dims"), "onUpdated");
+    checkDimensions((yield extension.awaitMessage("update-dims")), "update");
+    checkDimensions((yield extension.awaitMessage("on-updated-dims")), "onUpdated");
 
     extension.sendMessage("remove-tab", tabId);
     yield extension.awaitMessage("tab-removed");
   }
 
   yield extension.unload();
   SpecialPowers.clearUserPref(RESOLUTION_PREF);
 });
--- a/browser/components/extensions/test/browser/browser_ext_windows_create_url.js
+++ b/browser/components/extensions/test/browser/browser_ext_windows_create_url.js
@@ -7,32 +7,32 @@ add_task(function* testWindowCreate() {
     manifest: {
       permissions: ["tabs"],
     },
 
     background() {
       const EXTENSION_URL = browser.runtime.getURL("test.html");
       const REMOTE_URL = browser.runtime.getURL("test.html");
 
-      let windows = new class extends Map { // eslint-disable-line new-parens
+      let windows = new (class extends Map { // eslint-disable-line new-parens
         get(id) {
           if (!this.has(id)) {
             let window = {
               tabs: new Map(),
             };
             window.promise = new Promise(resolve => {
               window.resolvePromise = resolve;
             });
 
             this.set(id, window);
           }
 
           return super.get(id);
         }
-      };
+      });
 
       browser.tabs.onUpdated.addListener((tabId, changed, tab) => {
         if (changed.status == "complete" && tab.url !== "about:blank") {
           let window = windows.get(tab.windowId);
           window.tabs.set(tab.index, tab);
 
           if (window.tabs.size === window.expectedTabs) {
             window.resolvePromise(window);
--- a/browser/components/feeds/FeedWriter.js
+++ b/browser/components/feeds/FeedWriter.js
@@ -3,19 +3,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 const FEEDWRITER_CID = Components.ID("{49bb6593-3aff-4eb3-a068-2712c28bd58e}");
 const FEEDWRITER_CONTRACTID = "@mozilla.org/browser/feeds/result-writer;1";
 
 function LOG(str) {
   let prefB = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefBranch);
 
--- a/browser/components/feeds/test/unit/test_355473.js
+++ b/browser/components/feeds/test/unit/test_355473.js
@@ -1,10 +1,10 @@
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 function run_test() {
   var feedFeedURI = ios.newURI("feed://example.com/feed.xml", null, null);
   var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml", null, null);
   var httpURI = ios.newURI("http://example.com/feed.xml", null, null);
 
   var httpsFeedURI =
     ios.newURI("feed:https://example.com/feed.xml", null, null);
--- a/browser/components/migration/360seProfileMigrator.js
+++ b/browser/components/migration/360seProfileMigrator.js
@@ -1,23 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+/* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
 
 const kBookmarksFileName = "360sefav.db";
 
--- a/browser/components/migration/AutoMigrate.jsm
+++ b/browser/components/migration/AutoMigrate.jsm
@@ -23,22 +23,22 @@ const kPasswordManagerTopicTypes = new S
   "addLogin",
   "modifyLogin",
 ]);
 
 const kSyncTopic = "fxaccounts:onlogin";
 
 const kNotificationId = "abouthome-automigration-undo";
 
-Cu.import("resource:///modules/MigrationUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { MigrationUtils } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const AutoMigrate = {
   get resourceTypesToUse() {
     let {BOOKMARKS, HISTORY, PASSWORDS} = Ci.nsIBrowserProfileMigrator;
     return BOOKMARKS | HISTORY | PASSWORDS;
   },
 
   _checkIfEnabled() {
--- a/browser/components/migration/ChromeProfileMigrator.js
+++ b/browser/components/migration/ChromeProfileMigrator.js
@@ -14,24 +14,25 @@ const S100NS_FROM1601TO1970 = 0x19DB1DED
 const S100NS_PER_MS = 10;
 
 const AUTH_TYPE = {
   SCHEME_HTML: 0,
   SCHEME_BASIC: 1,
   SCHEME_DIGEST: 2
 };
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+/* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
 /**
  * Get an nsIFile instance representing the expected location of user data
  * for this copy of Chrome/Chromium/Canary on different OSes.
--- a/browser/components/migration/ESEDBReader.jsm
+++ b/browser/components/migration/ESEDBReader.jsm
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-this.EXPORTED_SYMBOLS = ["ESEDBReader"]; /* exported ESEDBReader */
+this.EXPORTED_SYMBOLS = ["ESEDBReader"];/* exported ESEDBReader */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/ctypes.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
     maxLogLevelPref: "browser.esedbreader.loglevel",
     prefix: "ESEDBReader",
   };
   return new ConsoleAPI(consoleOptions);
 });
--- a/browser/components/migration/EdgeProfileMigrator.js
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -1,23 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
-Cu.import("resource:///modules/MSMigrationUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { MSMigrationUtils } = Cu.import("resource:///modules/MSMigrationUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ESEDBReader",
                                   "resource:///modules/ESEDBReader.jsm");
 
 const kEdgeRegistryRoot = "SOFTWARE\\Classes\\Local Settings\\Software\\" +
   "Microsoft\\Windows\\CurrentVersion\\AppContainer\\Storage\\" +
   "microsoft.microsoftedge_8wekyb3d8bbwe\\MicrosoftEdge";
--- a/browser/components/migration/FirefoxProfileMigrator.js
+++ b/browser/components/migration/FirefoxProfileMigrator.js
@@ -1,28 +1,28 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
  * vim: sw=2 ts=2 sts=2 et */
- /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 /*
  * Migrates from a Firefox profile in a lossy manner in order to clean up a
  * user's profile.  Data is only migrated where the benefits outweigh the
  * potential problems caused by importing undesired/invalid configurations
  * from the source profile.
  */
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
                                   "resource://gre/modules/PlacesBackups.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionMigration",
                                   "resource:///modules/sessionstore/SessionMigration.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
--- a/browser/components/migration/IEProfileMigrator.js
+++ b/browser/components/migration/IEProfileMigrator.js
@@ -7,24 +7,24 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const kLoginsKey = "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
 const kMainKey = "Software\\Microsoft\\Internet Explorer\\Main";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
-Cu.import("resource:///modules/MSMigrationUtils.jsm");
-Cu.import("resource://gre/modules/LoginHelper.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { MSMigrationUtils } = Cu.import("resource:///modules/MSMigrationUtils.jsm", {});
+let { LoginHelper } = Cu.import("resource://gre/modules/LoginHelper.jsm", {});
 
 
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
--- a/browser/components/migration/MSMigrationUtils.jsm
+++ b/browser/components/migration/MSMigrationUtils.jsm
@@ -3,22 +3,22 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["MSMigrationUtils"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
-Cu.import("resource://gre/modules/LoginHelper.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { MigrationUtils } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { LoginHelper } = Cu.import("resource://gre/modules/LoginHelper.jsm", {});
 
 Cu.importGlobalProperties(["FileReader"]);
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
--- a/browser/components/migration/MigrationUtils.jsm
+++ b/browser/components/migration/MigrationUtils.jsm
@@ -6,20 +6,20 @@
 
 this.EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 const TOPIC_WILL_IMPORT_BOOKMARKS = "initial-migration-will-import-default-bookmarks";
 const TOPIC_DID_IMPORT_BOOKMARKS = "initial-migration-did-import-default-bookmarks";
 const TOPIC_PLACES_DEFAULTS_FINISHED = "places-browser-init-complete";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AutoMigrate",
                                   "resource:///modules/AutoMigrate.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
                                   "resource://gre/modules/BookmarkHTMLUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
--- a/browser/components/migration/SafariProfileMigrator.js
+++ b/browser/components/migration/SafariProfileMigrator.js
@@ -4,22 +4,23 @@
 
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { MigrationUtils, MigratorPrototype } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+/* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PropertyListUtils",
                                   "resource://gre/modules/PropertyListUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -6,18 +6,18 @@
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 const kIMig = Ci.nsIBrowserProfileMigrator;
 const kIPStartup = Ci.nsIProfileStartup;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { MigrationUtils } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
 
 var MigrationWizard = { /* exported MigrationWizard */
   _source: "",                  // Source Profile Migrator ContractID suffix
   _itemsFlags: kIMig.ALL,       // Selected Import Data Sources (16-bit bitfield)
   _selectedProfile: null,       // Selected Profile name to import from
   _wiz: null,
   _migrator: null,
   _autoMigrate: null,
--- a/browser/components/migration/tests/unit/head_migration.js
+++ b/browser/components/migration/tests/unit/head_migration.js
@@ -1,30 +1,31 @@
 "use strict";
 
 /* exported gProfD, promiseMigration, registerFakePath */
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties([ "URL" ]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
                                   "resource:///modules/MigrationUtils.jsm");
 
 // Initialize profile.
 var gProfD = do_get_profile();
 
-Cu.import("resource://testing-common/AppInfo.jsm"); /* globals updateAppInfo */
+let { updateAppInfo } = Cu.import("resource://testing-common/AppInfo.jsm", {});
+/* globals updateAppInfo */
 updateAppInfo();
 
 /**
  * Migrates the requested resource and waits for the migration to be complete.
  */
 function promiseMigration(migrator, resourceType, aProfile = null) {
   // Ensure resource migration is available.
   let availableSources = migrator.getMigrateData(aProfile, false);
--- a/browser/components/migration/tests/unit/test_Chrome_cookies.js
+++ b/browser/components/migration/tests/unit/test_Chrome_cookies.js
@@ -1,11 +1,11 @@
 "use strict";
 
-Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
+let { ForgetAboutSite } = Cu.import("resource://gre/modules/ForgetAboutSite.jsm", {});
 
 add_task(function* () {
   registerFakePath("ULibDir", do_get_file("Library/"));
   let migrator = MigrationUtils.getMigrator("chrome");
 
   Assert.ok(migrator.sourceExists, "Sanity check the source exists");
 
   const COOKIE = {
--- a/browser/components/migration/tests/unit/test_Chrome_passwords.js
+++ b/browser/components/migration/tests/unit/test_Chrome_passwords.js
@@ -1,12 +1,12 @@
 "use strict";
 
-Cu.import("resource://gre/modules/OSCrypto.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { OSCrypto } = Cu.import("resource://gre/modules/OSCrypto.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const PROFILE = {
   id: "Default",
   name: "Person 1",
 };
 
 const TEST_LOGINS = [
   {
--- a/browser/components/migration/tests/unit/test_Edge_db_migration.js
+++ b/browser/components/migration/tests/unit/test_Edge_db_migration.js
@@ -1,12 +1,12 @@
 "use strict";
 
-Cu.import("resource://gre/modules/ctypes.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 let eseBackStage = Cu.import("resource:///modules/ESEDBReader.jsm");
 let ESE = eseBackStage.ESE;
 let KERNEL = eseBackStage.KERNEL;
 let gLibs = eseBackStage.gLibs;
 let COLUMN_TYPES = eseBackStage.COLUMN_TYPES;
 let declareESEFunction = eseBackStage.declareESEFunction;
 let loadLibraries = eseBackStage.loadLibraries;
 
--- a/browser/components/migration/tests/unit/test_IE7_passwords.js
+++ b/browser/components/migration/tests/unit/test_IE7_passwords.js
@@ -1,12 +1,12 @@
 "use strict";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
 
 const IE7_FORM_PASSWORDS_MIGRATOR_NAME = "IE7FormPasswords";
 const LOGINS_KEY = "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
--- a/browser/components/migration/tests/unit/test_automigration.js
+++ b/browser/components/migration/tests/unit/test_automigration.js
@@ -1,16 +1,16 @@
 "use strict";
 
-Cu.import("resource:///modules/MigrationUtils.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://testing-common/TestUtils.jsm");
-Cu.import("resource://testing-common/PlacesTestUtils.jsm");
-let AutoMigrateBackstage = Cu.import("resource:///modules/AutoMigrate.jsm"); /* globals AutoMigrate */
+let { MigrationUtils } = Cu.import("resource:///modules/MigrationUtils.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { TestUtils } = Cu.import("resource://testing-common/TestUtils.jsm", {});
+let { PlacesTestUtils } = Cu.import("resource://testing-common/PlacesTestUtils.jsm", {});
+let AutoMigrateBackstage = Cu.import("resource:///modules/AutoMigrate.jsm");/* globals AutoMigrate */
 
 let gShimmedMigratorKeyPicker = null;
 let gShimmedMigrator = null;
 
 const kUsecPerMin = 60 * 1000000;
 
 // This is really a proxy on MigrationUtils, but if we specify that directly,
 // we get in trouble because the object itself is frozen, and Proxies can't
--- a/browser/components/newtab/NewTabMessages.jsm
+++ b/browser/components/newtab/NewTabMessages.jsm
@@ -9,19 +9,19 @@
   Task
 */
 
 /* exported NewTabMessages */
 
 "use strict";
 
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesProvider",
                                   "resource:///modules/PlacesProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PreviewProvider",
                                   "resource:///modules/PreviewProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
                                   "resource:///modules/NewTabPrefsProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabSearchProvider",
--- a/browser/components/newtab/NewTabPrefsProvider.jsm
+++ b/browser/components/newtab/NewTabPrefsProvider.jsm
@@ -1,19 +1,19 @@
 /* global Services, Preferences, EventEmitter, XPCOMUtils */
 /* exported NewTabPrefsProvider */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["NewTabPrefsProvider"];
 
 const {interfaces: Ci, utils: Cu} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
   const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
   return EventEmitter;
 });
 
 // Supported prefs and data type
 const gPrefsMap = new Map([
--- a/browser/components/newtab/NewTabSearchProvider.jsm
+++ b/browser/components/newtab/NewTabSearchProvider.jsm
@@ -3,19 +3,19 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["NewTabSearchProvider"];
 
 const {utils: Cu, interfaces: Ci} = Components;
 const CURRENT_ENGINE = "browser-search-engine-modified";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
                                   "resource:///modules/ContentSearch.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
   const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
   return EventEmitter;
 });
--- a/browser/components/newtab/NewTabURL.jsm
+++ b/browser/components/newtab/NewTabURL.jsm
@@ -6,17 +6,17 @@
 /* exported NewTabURL */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = ["NewTabURL"];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 
 this.NewTabURL = {
 
   get: function() {
     return aboutNewTabService.newTabURL;
--- a/browser/components/newtab/NewTabWebChannel.jsm
+++ b/browser/components/newtab/NewTabWebChannel.jsm
@@ -9,19 +9,19 @@
 */
 /* exported NewTabWebChannel */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["NewTabWebChannel"];
 
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
                                   "resource:///modules/NewTabPrefsProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabRemoteResources",
                                   "resource:///modules/NewTabRemoteResources.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
                                   "resource://gre/modules/WebChannel.jsm");
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
--- a/browser/components/newtab/PlacesProvider.jsm
+++ b/browser/components/newtab/PlacesProvider.jsm
@@ -6,18 +6,18 @@
 /* global gLinks */
 /* exported PlacesProvider */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PlacesProvider"];
 
 const {interfaces: Ci, utils: Cu} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
   const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
   return EventEmitter;
 });
--- a/browser/components/newtab/PreviewProvider.jsm
+++ b/browser/components/newtab/PreviewProvider.jsm
@@ -1,20 +1,20 @@
 /* global XPCOMUtils, BackgroundPageThumbs, FileUtils, PageThumbsStorage, Task, MIMEService */
 /* exported PreviewProvider */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PreviewProvider"];
 
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/PageThumbs.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { PageThumbsStorage } = Cu.import("resource://gre/modules/PageThumbs.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
 const {OS} = Cu.import("resource://gre/modules/osfile.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BackgroundPageThumbs",
   "resource://gre/modules/BackgroundPageThumbs.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "MIMEService",
   "@mozilla.org/mime;1", "nsIMIMEService");
 
 let PreviewProvider = {
--- a/browser/components/newtab/aboutNewTabService.js
+++ b/browser/components/newtab/aboutNewTabService.js
@@ -6,18 +6,18 @@
 
 /* globals XPCOMUtils, NewTabPrefsProvider, Services,
   Locale, UpdateUtils, NewTabRemoteResources
 */
 "use strict";
 
 const {utils: Cu, interfaces: Ci} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
                                   "resource://gre/modules/UpdateUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
                                   "resource:///modules/NewTabPrefsProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Locale",
                                   "resource://gre/modules/Locale.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabRemoteResources",
--- a/browser/components/newtab/tests/browser/browser_PreviewProvider.js
+++ b/browser/components/newtab/tests/browser/browser_PreviewProvider.js
@@ -1,15 +1,15 @@
 /* globals XPCOMUtils, Services, PreviewProvider, registerCleanupFunction */
 "use strict";
 
 let Cu = Components.utils;
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PreviewProvider",
                                   "resource:///modules/PreviewProvider.jsm");
 
 var oldEnabledPref = Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled");
 Services.prefs.setBoolPref("browser.pagethumbnails.capturing_disabled", false);
 
 registerCleanupFunction(function() {
--- a/browser/components/newtab/tests/browser/browser_newtab_overrides.js
+++ b/browser/components/newtab/tests/browser/browser_newtab_overrides.js
@@ -9,18 +9,18 @@
   is,
   content
 */
 
 "use strict";
 
 let Cu = Components.utils;
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Preferences.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 
 registerCleanupFunction(function() {
   Services.prefs.setBoolPref("browser.newtabpage.remote", false);
--- a/browser/components/newtab/tests/browser/browser_newtabmessages.js
+++ b/browser/components/newtab/tests/browser/browser_newtabmessages.js
@@ -1,16 +1,16 @@
 /* globals Cu, XPCOMUtils, Preferences, is, registerCleanupFunction, NewTabWebChannel,
 PlacesTestUtils, NewTabMessages, ok, Services, PlacesUtils, NetUtil, Task */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabWebChannel",
                                   "resource:///modules/NewTabWebChannel.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabMessages",
                                   "resource:///modules/NewTabMessages.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
                                   "resource://testing-common/PlacesTestUtils.jsm");
 
 let setup = Task.async(function*() {
--- a/browser/components/newtab/tests/browser/browser_newtabwebchannel.js
+++ b/browser/components/newtab/tests/browser/browser_newtabwebchannel.js
@@ -1,14 +1,14 @@
 /* globals XPCOMUtils, Cu, Preferences, NewTabWebChannel, is, registerCleanupFunction */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabWebChannel",
                                   "resource:///modules/NewTabWebChannel.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabMessages",
                                   "resource:///modules/NewTabMessages.jsm");
 
 const TEST_URL = "https://example.com/browser/browser/components/newtab/tests/browser/newtabwebchannel_basic.html";
 const TEST_URL_2 = "http://mochi.test:8888/browser/browser/components/newtab/tests/browser/newtabwebchannel_basic.html";
--- a/browser/components/newtab/tests/browser/browser_remotenewtab_pageloads.js
+++ b/browser/components/newtab/tests/browser/browser_remotenewtab_pageloads.js
@@ -1,13 +1,13 @@
 /* globals Cu, XPCOMUtils, TestUtils, aboutNewTabService, ContentTask, content, is */
 "use strict";
 
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 
 const TEST_URL = "https://example.com/browser/browser/components/newtab/tests/browser/dummy_page.html";
 
 /*
--- a/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
+++ b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
@@ -2,19 +2,19 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* globals Services, XPCOMUtils, NewTabPrefsProvider, Preferences, aboutNewTabService, do_register_cleanup */
 
 "use strict";
 
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
                                   "resource:///modules/NewTabPrefsProvider.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 
--- a/browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js
+++ b/browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js
@@ -1,17 +1,17 @@
 "use strict";
 
 /* global XPCOMUtils, equal, Preferences, NewTabPrefsProvider, run_next_test */
 /* exported run_test */
 /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
     "resource:///modules/NewTabPrefsProvider.jsm");
 
 function run_test() {
   run_next_test();
 }
 
--- a/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js
+++ b/browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js
@@ -1,17 +1,17 @@
 "use strict";
 
 /* global XPCOMUtils, NewTabSearchProvider, run_next_test, ok, equal, do_check_true, do_get_profile, Services */
 /* exported run_test */
 /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabSearchProvider",
     "resource:///modules/NewTabSearchProvider.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
                                   "resource:///modules/ContentSearch.jsm");
 
 // ensure a profile exists
 do_get_profile();
--- a/browser/components/newtab/tests/xpcshell/test_NewTabURL.js
+++ b/browser/components/newtab/tests/xpcshell/test_NewTabURL.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* globals Services, NewTabURL, XPCOMUtils, aboutNewTabService, NewTabPrefsProvider */
 "use strict";
 
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/NewTabURL.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { NewTabURL } = Cu.import("resource:///modules/NewTabURL.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
                                   "resource:///modules/NewTabPrefsProvider.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
                                    "@mozilla.org/browser/aboutnewtab-service;1",
                                    "nsIAboutNewTabService");
 
 add_task(function*() {
   let defaultURL = aboutNewTabService.newTabURL;
--- a/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js
+++ b/browser/components/newtab/tests/xpcshell/test_PlacesProvider.js
@@ -5,17 +5,17 @@
 /* global equal, ok */
 /* exported run_test */
 
 const {
   utils: Cu,
   interfaces: Ci,
 } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesProvider",
     "resource:///modules/PlacesProvider.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
     "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -4,19 +4,19 @@
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 Cu.import("resource://gre/modules/AsyncPrefs.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils", "@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
 XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-service;1", "nsIAlertsService");
 
 // lazy module getters
 [
   ["AboutHome", "resource:///modules/AboutHome.jsm"],
--- a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js
+++ b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js
@@ -1,15 +1,15 @@
 /**
  * Bug 1277803 - A test case for testing favicon loading across different first party domains.
  */
 
 const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 const FIRST_PARTY_ONE = "example.com";
 const FIRST_PARTY_TWO = "example.org";
 const THIRD_PARTY = "mochi.test:8888";
 
 const TEST_SITE_ONE = "http://" + FIRST_PARTY_ONE;
 const TEST_SITE_TWO = "http://" + FIRST_PARTY_TWO;
 const THIRD_PARTY_SITE = "http://" + THIRD_PARTY;
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -5,34 +5,32 @@
 
 this.EXPORTED_SYMBOLS = ["PlacesUIUtils"];
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { PlacesUtils, PlacesAggregatedTransaction, PlacesCreateFolderTransaction, PlacesCreateBookmarkTransaction, PlacesCreateSeparatorTransaction, PlacesCreateLivemarkTransaction, PlacesMoveItemTransaction, PlacesRemoveItemTransaction, PlacesEditItemTitleTransaction, PlacesEditBookmarkURITransaction, PlacesSetItemAnnotationTransaction, PlacesSetPageAnnotationTransaction, PlacesEditBookmarkKeywordTransaction, PlacesEditItemDateAddedTransaction, PlacesEditItemLastModifiedTransaction, PlacesSortFolderByNameTransaction, PlacesTagURITransaction, PlacesUntagURITransaction } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
                                   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
                                   "resource:///modules/RecentWindow.jsm");
 
-// PlacesUtils exposes multiple symbols, so we can't use defineLazyModuleGetter.
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { PlacesUtils, PlacesAggregatedTransaction, PlacesCreateFolderTransaction, PlacesCreateBookmarkTransaction, PlacesCreateSeparatorTransaction, PlacesCreateLivemarkTransaction, PlacesMoveItemTransaction, PlacesRemoveItemTransaction, PlacesEditItemTitleTransaction, PlacesEditBookmarkURITransaction, PlacesSetItemAnnotationTransaction, PlacesSetPageAnnotationTransaction, PlacesEditBookmarkKeywordTransaction, PlacesEditItemDateAddedTransaction, PlacesEditItemLastModifiedTransaction, PlacesSortFolderByNameTransaction, PlacesTagURITransaction, PlacesUntagURITransaction } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTransactions",
                                   "resource://gre/modules/PlacesTransactions.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "CloudSync",
                                   "resource://gre/modules/CloudSync.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Weave",
--- a/browser/components/places/content/editBookmarkOverlay.js
+++ b/browser/components/places/content/editBookmarkOverlay.js
@@ -514,17 +514,17 @@ var gEditItemOverlay = {
       Task.spawn(setTags).catch(Components.utils.reportError);
     return true;
   }),
 
   _updateTags: Task.async(function*() {
     let uris = this._paneInfo.bulkTagging ?
                  this._paneInfo.uris : [this._paneInfo.uri];
     let currentTags = this._paneInfo.bulkTagging ?
-                        yield this._getCommonTags() :
+                        (yield this._getCommonTags()) :
                         PlacesUtils.tagging.getTagsForURI(uris[0]);
     let anyChanges = yield this._setTagsFromTagsInputField(currentTags, uris);
     if (!anyChanges)
       return false;
 
     // The panel could have been closed in the meanwhile.
     if (!this._paneInfo)
       return false;
--- a/browser/components/places/tests/browser/browser_bookmarksProperties.js
+++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js
@@ -29,17 +29,17 @@ const ACTION_ADD = 1;
 const TYPE_FOLDER = 0;
 const TYPE_BOOKMARK = 1;
 
 const TEST_URL = "http://www.example.com/";
 
 const DIALOG_URL = "chrome://browser/content/places/bookmarkProperties.xul";
 const DIALOG_URL_MINIMAL_UI = "chrome://browser/content/places/bookmarkProperties2.xul";
 
-Cu.import("resource:///modules/RecentWindow.jsm");
+let { RecentWindow } = Cu.import("resource:///modules/RecentWindow.jsm", {});
 var win = RecentWindow.getMostRecentBrowserWindow();
 var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
          getService(Ci.nsIWindowWatcher);
 
 function add_bookmark(aURI) {
   var bId = PlacesUtils.bookmarks
                        .insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
                                        aURI,
--- a/browser/components/places/tests/unit/head_bookmarks.js
+++ b/browser/components/places/tests/unit/head_bookmarks.js
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/LoadContextInfo.jsm");
 
 // Import common head.
 var commonFile = do_get_file("../../../../../toolkit/components/places/tests/head_common.js", false);
 if (commonFile) {
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
--- a/browser/components/preferences/in-content/preferences.js
+++ b/browser/components/preferences/in-content/preferences.js
@@ -17,17 +17,17 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/AppConstants.jsm");
 
 var gLastHash = "";
 
 var gCategoryInits = new Map();
 function init_category_if_required(category) {
   let categoryInfo = gCategoryInits.get(category);
   if (!categoryInfo) {
--- a/browser/components/preferences/in-content/tests/browser_advanced_update.js
+++ b/browser/components/preferences/in-content/tests/browser_advanced_update.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components;
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
 
 const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
 const dateFormat = Cc["@mozilla.org/intl/scriptabledateformat;1"]
                       .getService(Components.interfaces.nsIScriptableDateFormat);
 
 const mockUpdateManager = {
   contractId: "@mozilla.org/updates/update-manager;1",
 
--- a/browser/components/preferences/translation.js
+++ b/browser/components/preferences/translation.js
@@ -2,18 +2,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "gLangBundle", () =>
   Services.strings.createBundle("chrome://global/locale/languageNames.properties"));
 
 const kPermissionType = "translate";
 const kLanguagesPref = "browser.translation.neverForLanguages";
 
 function Tree(aId, aData)
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const FAVICON_QUESTION = "chrome://global/skin/icons/question-32.png";
 const FAVICON_PRIVACY = "chrome://browser/skin/privatebrowsing/favicon.svg";
 
 var stringBundle = Services.strings.createBundle(
                     "chrome://browser/locale/aboutPrivateBrowsing.properties");
 
 var prefBranch = Services.prefs.getBranch("privacy.trackingprotection.");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Test to make sure that the visited page titles do not get updated inside the
 // private browsing mode.
 "use strict";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 add_task(function* test() {
   const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.html"
   const TEST_URI = Services.io.newURI(TEST_URL, null, null);
   const TITLE_1 = "Title 1";
   const TITLE_2 = "Title 2";
 
   function waitForTitleChanged() {
--- a/browser/components/search/content/searchReset.js
+++ b/browser/components/search/content/searchReset.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const TELEMETRY_RESULT_ENUM = {
   RESTORED_DEFAULT: 0,
   KEPT_CURRENT: 1,
   CHANGED_ENGINE: 2,
   CLOSED_PAGE: 3,
   OPENED_SETTINGS: 4
 };
--- a/browser/components/search/test/head.js
+++ b/browser/components/search/test/head.js
@@ -1,12 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 /**
  * Recursively compare two objects and check that every property of expectedObj has the same value
  * on actualObj.
  */
 function isSubObjectOf(expectedObj, actualObj, name) {
   for (let prop in expectedObj) {
     if (typeof expectedObj[prop] == 'function')
--- a/browser/components/selfsupport/SelfSupportService.js
+++ b/browser/components/selfsupport/SelfSupportService.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
 
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryArchive",
                                   "resource://gre/modules/TelemetryArchive.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
                                   "resource://gre/modules/TelemetryEnvironment.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryController",
--- a/browser/components/selfsupport/test/browser_selfsupportAPI.js
+++ b/browser/components/selfsupport/test/browser_selfsupportAPI.js
@@ -1,9 +1,9 @@
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 function test_resetPref() {
   const prefNewName = "browser.newpref.fake";
   Assert.ok(!Preferences.has(prefNewName), "pref should not exist");
 
   const prefExistingName = "extensions.hotfix.id";
   Assert.ok(Preferences.has(prefExistingName), "pref should exist");
   Assert.ok(!Preferences.isSet(prefExistingName), "pref should not be user-set");
--- a/browser/components/sessionstore/PrivacyLevel.jsm
+++ b/browser/components/sessionstore/PrivacyLevel.jsm
@@ -3,17 +3,17 @@
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PrivacyLevel"];
 
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const PREF = "browser.sessionstore.privacy_level";
 
 // The following constants represent the different possible privacy levels that
 // can be set by the user and that we need to consider when collecting text
 // data, and cookies.
 //
 // Collect data from all sites (http and https).
--- a/browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm
+++ b/browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm
@@ -6,18 +6,18 @@ this.EXPORTED_SYMBOLS = ["RecentlyClosed
 
 const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
                                   "resource:///modules/sessionstore/SessionStore.jsm");
 
 var navigatorBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
--- a/browser/components/sessionstore/SessionHistory.jsm
+++ b/browser/components/sessionstore/SessionHistory.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["SessionHistory"];
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Utils",
   "resource:///modules/sessionstore/Utils.jsm");
 
 function debug(msg) {
   Services.console.logStringMessage("SessionHistory: " + msg);
 }
 
--- a/browser/components/sessionstore/SessionStorage.jsm
+++ b/browser/components/sessionstore/SessionStorage.jsm
@@ -4,18 +4,18 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["SessionStorage"];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "console",
   "resource://gre/modules/Console.jsm");
 
 // Returns the principal for a given |frame| contained in a given |docShell|.
 function getPrincipalForFrame(docShell, frame) {
   let ssm = Services.scriptSecurityManager;
   let uri = frame.document.documentURIObject;
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
 
 var gStateObject;
 var gTreeData;
 
 // Page initialization
 
--- a/browser/components/sessionstore/nsSessionStartup.js
+++ b/browser/components/sessionstore/nsSessionStartup.js
@@ -30,21 +30,21 @@
  */
 
 /* :::::::: Constants and Helpers ::::::::::::::: */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/TelemetryStopwatch.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "console",
   "resource://gre/modules/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
   "resource:///modules/sessionstore/SessionFile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "StartupPerformance",
   "resource:///modules/sessionstore/StartupPerformance.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CrashMonitor",
--- a/browser/components/sessionstore/nsSessionStore.js
+++ b/browser/components/sessionstore/nsSessionStore.js
@@ -14,18 +14,18 @@
  * profile directory. The service is started at first window load, in
  * delayedStartup, and will restore the session from the data received from
  * the nsSessionStartup service.
  */
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/sessionstore/SessionStore.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { SessionStore } = Cu.import("resource:///modules/sessionstore/SessionStore.jsm", {});
 
 function SessionStoreService() {}
 
 // The SessionStore module's object is frozen. We need to modify our prototype
 // and add some properties so let's just copy the SessionStore object.
 Object.keys(SessionStore).forEach(function (aName) {
   let desc = Object.getOwnPropertyDescriptor(SessionStore, aName);
   Object.defineProperty(SessionStoreService.prototype, aName, desc);
--- a/browser/components/sessionstore/test/browser_394759_basic.js
+++ b/browser/components/sessionstore/test/browser_394759_basic.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const TEST_URL = "data:text/html;charset=utf-8,<input%20id=txt>" +
                  "<input%20type=checkbox%20id=chk>";
 
-Cu.import("resource:///modules/sessionstore/SessionStore.jsm");
+let { SessionStore } = Cu.import("resource:///modules/sessionstore/SessionStore.jsm", {});
 
 /**
  * This test ensures that closing a window is a reversible action. We will
  * close the the window, restore it and check that all data has been restored.
  * This includes window-specific data as well as form data for tabs.
  */
 function test() {
   waitForExplicitFinish();
--- a/browser/components/sessionstore/test/browser_461634.js
+++ b/browser/components/sessionstore/test/browser_461634.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource:///modules/sessionstore/SessionStore.jsm");
+let { SessionStore } = Cu.import("resource:///modules/sessionstore/SessionStore.jsm", {});
 
 function test() {
   /** Test for Bug 461634 **/
 
   waitForExplicitFinish();
 
   const REMEMBER = Date.now(), FORGET = Math.random();
   let test_state = { windows: [{ "tabs": [{ "entries": [] }], _closedTabs: [
--- a/browser/components/sessionstore/test/content.js
+++ b/browser/components/sessionstore/test/content.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var Cu = Components.utils;
 var Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource:///modules/sessionstore/FrameTree.jsm", this);
 var gFrameTree = new FrameTree(this);
 
 function executeSoon(callback) {
   Services.tm.mainThread.dispatch(callback, Components.interfaces.nsIThread.DISPATCH_NORMAL);
 }
 
 gFrameTree.addObserver({
--- a/browser/components/shell/ShellService.jsm
+++ b/browser/components/shell/ShellService.jsm
@@ -3,19 +3,19 @@
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ShellService"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 
 /**
  * Internal functionality to save and restore the docShell.allow* properties.
  */
 let ShellServiceInternal = {
   /**
--- a/browser/components/syncedtabs/SyncedTabsDeckComponent.js
+++ b/browser/components/syncedtabs/SyncedTabsDeckComponent.js
@@ -1,24 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckStore.js");
-Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckView.js");
-Cu.import("resource:///modules/syncedtabs/SyncedTabsListStore.js");
-Cu.import("resource:///modules/syncedtabs/TabListComponent.js");
-Cu.import("resource:///modules/syncedtabs/TabListView.js");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { SyncedTabsDeckStore } = Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckStore.js", {});
+let { SyncedTabsDeckView } = Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckView.js", {});
+let { SyncedTabsListStore } = Cu.import("resource:///modules/syncedtabs/SyncedTabsListStore.js", {});
+let { TabListComponent } = Cu.import("resource:///modules/syncedtabs/TabListComponent.js", {});
+let { TabListView } = Cu.import("resource:///modules/syncedtabs/TabListView.js", {});
 let { getChromeWindow } = Cu.import("resource:///modules/syncedtabs/util.js", {});
 
 XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
   return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 let log = Cu.import("resource://gre/modules/Log.jsm", {})
             .Log.repository.getLogger("Sync.RemoteTabs");
--- a/browser/components/syncedtabs/TabListComponent.js
+++ b/browser/components/syncedtabs/TabListComponent.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 let log = Cu.import("resource://gre/modules/Log.jsm", {})
             .Log.repository.getLogger("Sync.RemoteTabs");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
   "resource:///modules/BrowserUITelemetry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
   "resource:///modules/PlacesUIUtils.jsm");
--- a/browser/components/syncedtabs/TabListView.js
+++ b/browser/components/syncedtabs/TabListView.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let { getChromeWindow } = Cu.import("resource:///modules/syncedtabs/util.js", {});
 
 let log = Cu.import("resource://gre/modules/Log.jsm", {})
             .Log.repository.getLogger("Sync.RemoteTabs");
 
 this.EXPORTED_SYMBOLS = [
   "TabListView"
--- a/browser/components/syncedtabs/sidebar.js
+++ b/browser/components/syncedtabs/sidebar.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://services-sync/SyncedTabs.jsm");
-Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckComponent.js");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { SyncedTabs } = Cu.import("resource://services-sync/SyncedTabs.jsm", {});
+let { SyncedTabsDeckComponent } = Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckComponent.js", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
                                   "resource://gre/modules/FxAccounts.jsm");
 
 this.syncedTabsDeckComponent = new SyncedTabsDeckComponent({window, SyncedTabs, fxAccounts});
 
 let onLoaded = () => {
   syncedTabsDeckComponent.init();
--- a/browser/components/syncedtabs/test/xpcshell/head.js
+++ b/browser/components/syncedtabs/test/xpcshell/head.js
@@ -1,18 +1,18 @@
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
   return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
-Cu.import("resource://gre/modules/Timer.jsm");
+let { setTimeout, clearTimeout, setInterval, clearInterval } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 do_get_profile(); // fxa needs a profile directory for storage.
 
 // Create a window polyfill so sinon can load
 let window = {
     document: {},
     location: {},
     setTimeout: setTimeout,
--- a/browser/components/tests/browser/browser_contentpermissionprompt.js
+++ b/browser/components/tests/browser/browser_contentpermissionprompt.js
@@ -1,17 +1,17 @@
 /**
  * These tests test nsBrowserGlue's nsIContentPermissionPrompt
  * implementation behaviour with various types of
  * nsIContentPermissionRequests.
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Integration.jsm", this);
 
 XPCOMUtils.defineLazyServiceGetter(this, "ContentPermissionPrompt",
                                    "@mozilla.org/content-permission/prompt;1",
                                    "nsIContentPermissionPrompt");
 
 /**
  * This is a partial implementation of nsIContentPermissionType.
--- a/browser/components/translation/BingTranslator.jsm
+++ b/browser/components/translation/BingTranslator.jsm
@@ -3,26 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = [ "BingTranslator" ];
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Http.jsm");
+let { httpRequest } = Cu.import("resource://gre/modules/Http.jsm", {});
 
 // The maximum amount of net data allowed per request on Bing's API.
 const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere
-                               // close to that is refused by the service.
+// close to that is refused by the service.
 
 // The maximum number of chunks allowed to be translated in a single
 // request.
 const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000.
 
 // Self-imposed limit of 15 requests. This means that a page that would need
 // to be broken in more than 15 requests won't be fully translated.
 // The maximum amount of data that we will translate for a single page
--- a/browser/components/translation/Translation.jsm
+++ b/browser/components/translation/Translation.jsm
@@ -9,17 +9,17 @@ this.EXPORTED_SYMBOLS = [
   "TranslationTelemetry",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const TRANSLATION_PREF_SHOWUI = "browser.translation.ui.show";
 const TRANSLATION_PREF_DETECT_LANG = "browser.translation.detectLanguage";
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Task.jsm", this);
 
 this.Translation = {
   STATE_OFFER: 0,
   STATE_TRANSLATING: 1,
   STATE_TRANSLATED: 2,
   STATE_ERROR: 3,
--- a/browser/components/translation/TranslationContentHandler.jsm
+++ b/browser/components/translation/TranslationContentHandler.jsm
@@ -3,18 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "TranslationContentHandler" ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
   "resource:///modules/translation/LanguageDetector.jsm");
 
 const STATE_OFFER = 0;
 const STATE_TRANSLATED = 2;
 const STATE_ERROR = 3;
 
 this.TranslationContentHandler = function(global, docShell) {
--- a/browser/components/translation/TranslationDocument.jsm
+++ b/browser/components/translation/TranslationDocument.jsm
@@ -8,17 +8,17 @@ const {classes: Cc, interfaces: Ci, util
 
 this.EXPORTED_SYMBOLS = [ "TranslationDocument" ];
 
 const SHOW_ELEMENT = Ci.nsIDOMNodeFilter.SHOW_ELEMENT;
 const SHOW_TEXT = Ci.nsIDOMNodeFilter.SHOW_TEXT;
 const TEXT_NODE = Ci.nsIDOMNode.TEXT_NODE;
 
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 /**
  * This class represents a document that is being translated,
  * and it is responsible for parsing the document,
  * generating the data structures translation (the list of
  * translation items and roots), and managing the original
  * and translated texts on the translation items.
  *
@@ -365,25 +365,25 @@ const TranslationItem_NodePlaceholder = 
  */
 function generateTranslationHtmlForItem(item, content) {
   let localName = item.isRoot ? "div" : "b";
   return '<' + localName + ' id=n' + item.id + '>' +
          content +
          "</" + localName + ">";
 }
 
- /**
- * Regenerate the text string that represents a TranslationItem object,
- * with data from its "original" array. The array must have already
- * been created by TranslationDocument.generateTextForItem().
- *
- * @param item     A TranslationItem object
- *
- * @returns        A string representation of the TranslationItem.
- */
+/**
+* Regenerate the text string that represents a TranslationItem object,
+* with data from its "original" array. The array must have already
+* been created by TranslationDocument.generateTextForItem().
+*
+* @param item     A TranslationItem object
+*
+* @returns        A string representation of the TranslationItem.
+*/
 function regenerateTextFromOriginalHelper(item) {
   if (item.isSimpleRoot) {
     return item.original[0];
   }
 
   let str = "";
   for (let child of item.original) {
     if (child instanceof TranslationItem) {
--- a/browser/components/translation/YandexTranslator.jsm
+++ b/browser/components/translation/YandexTranslator.jsm
@@ -3,26 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = [ "YandexTranslator" ];
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Http.jsm");
+let { httpRequest } = Cu.import("resource://gre/modules/Http.jsm", {});
 
 // The maximum amount of net data allowed per request on Bing's API.
 const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere
-                               // close to that is refused by the service.
+// close to that is refused by the service.
 
 // The maximum number of chunks allowed to be translated in a single
 // request.
 const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000.
 
 // Self-imposed limit of 15 requests. This means that a page that would need
 // to be broken in more than 15 requests won't be fully translated.
 // The maximum amount of data that we will translate for a single page
--- a/browser/components/translation/cld2/cld-worker.js
+++ b/browser/components/translation/cld2/cld-worker.js
@@ -59,17 +59,17 @@ var Ua=[Lf,Rd,Td,ce,Te,Lf,Lf,Lf];var Va=
 // EMSCRIPTEN_END_ASM
 (c.L,c.M,buffer),zb=c._emscripten_bind_LanguageInfo_getLanguageCode_0=M._emscripten_bind_LanguageInfo_getLanguageCode_0,pb=c._bitshift64Lshr=M._bitshift64Lshr,qb=c._bitshift64Shl=M._bitshift64Shl,Ab=c._emscripten_bind_LanguageGuess_getLanguageCode_0=M._emscripten_bind_LanguageGuess_getLanguageCode_0;c.___cxa_is_pointer_type=M.___cxa_is_pointer_type;
 var Bb=c._emscripten_bind_LanguageGuess_getPercent_0=M._emscripten_bind_LanguageGuess_getPercent_0,Cb=c._emscripten_bind_VoidPtr___destroy___0=M._emscripten_bind_VoidPtr___destroy___0,nb=c._memset=M._memset,sb=c._memcpy=M._memcpy,Db=c._emscripten_bind_LanguageInfo_getIsReliable_0=M._emscripten_bind_LanguageInfo_getIsReliable_0,gb=c._i64Subtract=M._i64Subtract,Eb=c._emscripten_bind_LanguageInfo___destroy___0=M._emscripten_bind_LanguageInfo___destroy___0,fb=c._i64Add=M._i64Add,Fb=c._emscripten_bind_LanguageInfo_get_languages_1=
 M._emscripten_bind_LanguageInfo_get_languages_1,Gb=c._emscripten_bind_Language_getLanguageCode_0=M._emscripten_bind_Language_getLanguageCode_0,Hb=c._emscripten_bind_LanguageGuess___destroy___0=M._emscripten_bind_LanguageGuess___destroy___0,Ib=c._emscripten_bind_Language___destroy___0=M._emscripten_bind_Language___destroy___0;c.___cxa_can_catch=M.___cxa_can_catch;var Ga=c._free=M._free;c.runPostSets=M.runPostSets;
 var Jb=c._emscripten_bind_LanguageInfo_detectLanguage_5=M._emscripten_bind_LanguageInfo_detectLanguage_5,wb=c._memmove=M._memmove,Kb=c._emscripten_bind_LanguageInfo_detectLanguage_2=M._emscripten_bind_LanguageInfo_detectLanguage_2,D=c._malloc=M._malloc,Oa=c._emscripten_replace_memory=M._emscripten_replace_memory;c.dynCall_iiii=M.dynCall_iiii;c.dynCall_viiiii=M.dynCall_viiiii;c.dynCall_vi=M.dynCall_vi;c.dynCall_ii=M.dynCall_ii;c.dynCall_v=M.dynCall_v;c.dynCall_viiiiii=M.dynCall_viiiiii;
 c.dynCall_viiii=M.dynCall_viiii;t.n=M.stackAlloc;t.w=M.stackSave;t.o=M.stackRestore;t.ba=M.establishStackSpace;t.V=M.setTempRet0;t.R=M.getTempRet0;
 if(K)if("function"===typeof c.locateFile?K=c.locateFile(K):c.memoryInitializerPrefixURL&&(K=c.memoryInitializerPrefixURL+K),m||ca){var Lb=c.readBinary(K);E.set(Lb,t.C)}else{var Nb=function(){c.readAsync(K,Mb,function(){throw"could not load memory initializer "+K;})};bb();var Mb=function(a){a.byteLength&&(a=new Uint8Array(a));E.set(a,t.C);c.memoryInitializerRequest&&delete c.memoryInitializerRequest.response;cb()};if(c.memoryInitializerRequest){var Ob=function(){var a=c.memoryInitializerRequest;200!==
 a.status&&0!==a.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+a.status+", retrying "+K),Nb()):Mb(a.response)};c.memoryInitializerRequest.response?setTimeout(Ob,0):c.memoryInitializerRequest.addEventListener("load",Ob)}else Nb()}function n(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}n.prototype=Error();n.prototype.constructor=n;var Pb=null,ab=function Qb(){c.calledRun||Rb();c.calledRun||(ab=Qb)};
-c.callMain=c.Z=function(a){function b(){for(var a=0;3>a;a++)e.push(0)}a=a||[];za||(za=!0,H(Ta));var d=a.length+1,e=[xa(Za(c.thisProgram),"i8",0)];b();for(var f=0;f<d-1;f+=1)e.push(xa(Za(a[f]),"i8",0)),b();e.push(0);e=xa(e,"i32",0);try{var l=c._main(d,e,0);Sb(l,!0)}catch(h){if(!(h instanceof n))if("SimulateInfiniteLoop"==h)c.noExitRuntime=!0;else throw h&&"object"===typeof h&&h.stack&&c.u("exception thrown: "+[h,h.stack]),h;}finally{}};
+c.callMain=c.Z=function(a){function b(){for(var a=0;3>a;a++)e.push(0)}a=a||[];za||(za=!0,H(Ta));var d=a.length+1,e=[xa(Za(c.thisProgram),"i8",0)];b();for(var f=0;f<d-1;f+=1)e.push(xa(Za(a[f]),"i8",0)),b();e.push(0);e=xa(e,"i32",0);try{var l=c._main(d,e,0);Sb(l,!0)}catch(h){if(!(h instanceof n))if("SimulateInfiniteLoop"==h)c.noExitRuntime=!0;else throw (h&&"object"===typeof h&&h.stack&&c.u("exception thrown: "+[h,h.stack]), h);}finally{}};
 function Rb(a){function b(){if(!c.calledRun&&(c.calledRun=!0,!ia)){za||(za=!0,H(Ta));H(Ua);if(c.onRuntimeInitialized)c.onRuntimeInitialized();c._main&&Tb&&c.callMain(a);if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;)Ya(c.postRun.shift());H(Va)}}a=a||c.arguments;null===Pb&&(Pb=Date.now());if(!(0<J)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)Wa(c.preRun.shift());H(Sa);0<J||c.calledRun||(c.setStatus?(c.setStatus("Running..."),
 setTimeout(function(){setTimeout(function(){c.setStatus("")},1);b()},1)):b())}}c.run=c.run=Rb;function Sb(a,b){if(!b||!c.noExitRuntime){if(!c.noExitRuntime&&(ia=!0,p=void 0,H(I),c.onExit))c.onExit(a);m?process.exit(a):ca&&"function"===typeof quit&&quit(a);throw new n(a);}}c.exit=c.exit=Sb;var Ub=[];
 function y(a){void 0!==a?(c.print(a),c.u(a),a=JSON.stringify(a)):a="";ia=!0;var b="abort("+a+") at "+Ea()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";Ub&&Ub.forEach(function(d){b=d(b,a)});throw b;}c.abort=c.abort=y;if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();var Tb=!1;c.noInitialRun&&(Tb=!1);c.noExitRuntime=!0;Rb();function R(){}R.prototype=Object.create(R.prototype);
 R.prototype.constructor=R;R.prototype.c=R;R.e={};c.WrapperObject=R;function Vb(a){return(a||R).e}c.getCache=Vb;function S(a,b){var d=Vb(b),e=d[a];if(e)return e;e=Object.create((b||R).prototype);e.a=a;return d[a]=e}c.wrapPointer=S;c.castObject=function(a,b){return S(a.a,b)};c.NULL=S(0);c.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();delete Vb(a.c)[a.a]};c.compare=function(a,b){return a.a===b.a};c.getPointer=function(a){return a.a};
 c.getClass=function(a){return a.c};
 var T={buffer:0,size:0,j:0,p:[],i:0,t:function(){if(this.i){for(var a=0;a<this.p.length;a++)c._free(this.p[a]);this.p.length=0;c._free(this.buffer);this.buffer=0;this.size+=this.i;this.i=0}this.buffer||(this.size+=128,this.buffer=c._malloc(this.size),assert(this.buffer));this.j=0},f:function(a,b){assert(this.buffer);var d=b.BYTES_PER_ELEMENT,e=a.length*d,e=e+7&-8,f;this.j+e>=this.size?(assert(0<e),this.i+=e,f=c._malloc(e),this.p.push(f)):(f=this.buffer+this.j,this.j+=e);e=f;switch(d){case 2:e>>=1;
 break;case 4:e>>=2;break;case 8:e>>=3}for(d=0;d<a.length;d++)b[e+d]=a[d];return f}};function Wb(a){return"string"===typeof a?T.f(Za(a),B):a}function U(){throw"cannot construct a Language, no constructor in IDL";}U.prototype=Object.create(R.prototype);U.prototype.constructor=U;U.prototype.c=U;U.e={};c.Language=U;U.prototype.getLanguageCode=U.prototype.m=function(){return z(Gb(this.a))};U.prototype.__destroy__=function(){Ib(this.a)};
 function V(){throw"cannot construct a LanguageGuess, no constructor in IDL";}V.prototype=Object.create(U.prototype);V.prototype.constructor=V;V.prototype.c=V;V.e={};c.LanguageGuess=V;V.prototype.getPercent=V.prototype.P=function(){return Bb(this.a)};V.prototype.getLanguageCode=V.prototype.m=function(){return z(Ab(this.a))};V.prototype.__destroy__=function(){Hb(this.a)};function W(){throw"cannot construct a LanguageInfo, no constructor in IDL";}W.prototype=Object.create(U.prototype);
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -3,25 +3,25 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["UITour"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource:///modules/RecentWindow.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/TelemetryController.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { RecentWindow } = Cu.import("resource:///modules/RecentWindow.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { TelemetryController } = Cu.import("resource://gre/modules/TelemetryController.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 Cu.importGlobalProperties(["URL"]);
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ResetProfile",
   "resource://gre/modules/ResetProfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
--- a/browser/components/uitour/test/head.js
+++ b/browser/components/uitour/test/head.js
@@ -1,12 +1,12 @@
 "use strict";
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "UITour",
                                   "resource:///modules/UITour.jsm");
 
 
 const SINGLE_TRY_TIMEOUT = 100;
 const NUMBER_OF_TRIES = 30;
 
 function waitForConditionPromise(condition, timeoutMsg, tryCount=NUMBER_OF_TRIES) {
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -5,23 +5,23 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "Experiments",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 Cu.import("resource://gre/modules/AsyncShutdown.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
                                   "resource://gre/modules/UpdateUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
                                   "resource://gre/modules/AddonManager.jsm");
--- a/browser/experiments/ExperimentsService.js
+++ b/browser/experiments/ExperimentsService.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Experiments",
                                   "resource:///modules/experiments/Experiments.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 
--- a/browser/experiments/test/addons/experiment-racybranch/bootstrap.js
+++ b/browser/experiments/test/addons/experiment-racybranch/bootstrap.js
@@ -1,11 +1,11 @@
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 var gStarted = false;
 
 function startup(data, reasonCode) {
   if (gStarted) {
     return;
   }
   gStarted = true;
--- a/browser/experiments/test/xpcshell/head.js
+++ b/browser/experiments/test/xpcshell/head.js
@@ -1,20 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 Cu.import("resource://testing-common/AddonManagerTesting.jsm");
-Cu.import("resource://testing-common/AddonTestUtils.jsm");
+let { AddonTestUtils } = Cu.import("resource://testing-common/AddonTestUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 
 const PREF_EXPERIMENTS_ENABLED  = "experiments.enabled";
 const PREF_LOGGING_LEVEL        = "experiments.logging.level";
 const PREF_LOGGING_DUMP         = "experiments.logging.dump";
 const PREF_MANIFEST_URI         = "experiments.manifest.uri";
--- a/browser/experiments/test/xpcshell/test_activate.js
+++ b/browser/experiments/test/xpcshell/test_activate.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 const FILE_MANIFEST            = "experiments.manifest";
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
 const MS_IN_ONE_DAY   = SEC_IN_ONE_DAY * 1000;
 
 var gProfileDir = null;
 var gHttpServer = null;
 var gHttpRoot   = null;
--- a/browser/experiments/test/xpcshell/test_api.js
+++ b/browser/experiments/test/xpcshell/test_api.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/AddonManagerTesting.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { AddonManagerTesting } = Cu.import("resource://testing-common/AddonManagerTesting.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Experiments",
   "resource:///modules/experiments/Experiments.jsm");
 
 const FILE_MANIFEST            = "experiments.manifest";
 const MANIFEST_HANDLER         = "manifests/handler";
 
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
--- a/browser/experiments/test/xpcshell/test_cache.js
+++ b/browser/experiments/test/xpcshell/test_cache.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Experiments",
   "resource:///modules/experiments/Experiments.jsm");
 
 const MANIFEST_HANDLER         = "manifests/handler";
 
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
 const MS_IN_ONE_DAY   = SEC_IN_ONE_DAY * 1000;
 
--- a/browser/experiments/test/xpcshell/test_cacherace.js
+++ b/browser/experiments/test/xpcshell/test_cacherace.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 const MANIFEST_HANDLER         = "manifests/handler";
 
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
 const MS_IN_ONE_DAY   = SEC_IN_ONE_DAY * 1000;
 
 var gProfileDir          = null;
 var gHttpServer          = null;
--- a/browser/experiments/test/xpcshell/test_conditions.js
+++ b/browser/experiments/test/xpcshell/test_conditions.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
 
 const FILE_MANIFEST            = "experiments.manifest";
 const SEC_IN_ONE_DAY = 24 * 60 * 60;
 const MS_IN_ONE_DAY  = SEC_IN_ONE_DAY * 1000;
 
 var gProfileDir = null;
 var gHttpServer = null;
--- a/browser/experiments/test/xpcshell/test_disableExperiments.js
+++ b/browser/experiments/test/xpcshell/test_disableExperiments.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 Cu.import("resource://testing-common/AddonManagerTesting.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Experiments",
   "resource:///modules/experiments/Experiments.jsm");
 
 const FILE_MANIFEST            = "experiments.manifest";
 const MANIFEST_HANDLER         = "manifests/handler";
 
--- a/browser/experiments/test/xpcshell/test_fetch.js
+++ b/browser/experiments/test/xpcshell/test_fetch.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/Services.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 var gProfileDir = null;
 var gHttpServer = null;
 var gHttpRoot   = null;
 var gPolicy     = new Experiments.Policy();
 
 function run_test() {
   loadAddonManager();
--- a/browser/experiments/test/xpcshell/test_nethang_bug1012924.js
+++ b/browser/experiments/test/xpcshell/test_nethang_bug1012924.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 const MANIFEST_HANDLER         = "manifests/handler";
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* test_setup() {
--- a/browser/experiments/test/xpcshell/test_previous_provider.js
+++ b/browser/experiments/test/xpcshell/test_previous_provider.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource:///modules/experiments/Experiments.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gDataRoot;
 var gHttpServer;
 var gManifestObject;
 
 function run_test() {
   run_next_test();
 }
--- a/browser/experiments/test/xpcshell/test_telemetry.js
+++ b/browser/experiments/test/xpcshell/test_telemetry.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/TelemetryLog.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { TelemetryLog } = Cu.import("resource://gre/modules/TelemetryLog.jsm", {});
 var bsp = Cu.import("resource:///modules/experiments/Experiments.jsm");
 
 
 const FILE_MANIFEST            = "experiments.manifest";
 const MANIFEST_HANDLER         = "manifests/handler";
 
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
 const MS_IN_ONE_DAY   = SEC_IN_ONE_DAY * 1000;
--- a/browser/experiments/test/xpcshell/test_telemetry_disabled.js
+++ b/browser/experiments/test/xpcshell/test_telemetry_disabled.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 add_test(function test_experiments_activation() {
   do_get_profile();
   loadAddonManager();
 
   Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true);
   Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, false);
 
--- a/browser/experiments/test/xpcshell/test_upgrade.js
+++ b/browser/experiments/test/xpcshell/test_upgrade.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
-Cu.import("resource:///modules/experiments/Experiments.jsm");
+let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
 
 const SEC_IN_ONE_DAY  = 24 * 60 * 60;
 const MS_IN_ONE_DAY   = SEC_IN_ONE_DAY * 1000;
 
 var cacheData = {
   _enabled: true,
   _manifestData: {
     id: "foobartestid",
--- a/browser/extensions/e10srollout/bootstrap.js
+++ b/browser/extensions/e10srollout/bootstrap.js
@@ -1,24 +1,22 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/TelemetryArchive.jsm");
-Cu.import("resource://gre/modules/TelemetryController.jsm");
-
- // The amount of people to be part of e10s
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { TelemetryArchive } = Cu.import("resource://gre/modules/TelemetryArchive.jsm", {});
+let { TelemetryController } = Cu.import("resource://gre/modules/TelemetryController.jsm", {});
 const TEST_THRESHOLD = {
   "beta"    : 0.5,  // 50%
   "release" : 1.0,  // 100%
 };
 
 const ADDON_ROLLOUT_POLICY = {
   "beta"    : "50allmpc", // Any WebExtension or addon with mpc = true
   "release" : "49a", // 10 tested add-ons + any WebExtension
--- a/browser/extensions/flyweb/bootstrap.js
+++ b/browser/extensions/flyweb/bootstrap.js
@@ -1,16 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
                                   "resource:///modules/CustomizableUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Console",
                                   "resource://gre/modules/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Integration",
--- a/browser/extensions/formautofill/test/unit/head.js
+++ b/browser/extensions/formautofill/test/unit/head.js
@@ -1,19 +1,19 @@
 /**
  * Provides infrastructure for automated login components tests.
  */
 
- /* exported importAutofillModule */
+/* exported importAutofillModule */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://testing-common/MockDocument.jsm");
 
 // Load the module by Service newFileURI API for running extension's XPCShell test
 function importAutofillModule(module) {
   return Cu.import(Services.io.newFileURI(do_get_file(module)).spec);
 }
 
 add_task(function* test_common_initialize() {
--- a/browser/extensions/pdfjs/content/PdfJs.jsm
+++ b/browser/extensions/pdfjs/content/PdfJs.jsm
@@ -33,18 +33,18 @@ const PREF_PREVIOUS_ACTION = PREF_PREFIX
 const PREF_PREVIOUS_ASK = PREF_PREFIX +
                           '.previousHandler.alwaysAskBeforeHandling';
 const PREF_DISABLED_PLUGIN_TYPES = 'plugin.disable_full_page_plugin_for_types';
 const TOPIC_PDFJS_HANDLER_CHANGED = 'pdfjs:handlerChanged';
 const TOPIC_PLUGINS_LIST_UPDATED = 'plugins-list-updated';
 const TOPIC_PLUGIN_INFO_UPDATED = 'plugin-info-updated';
 const PDF_CONTENT_TYPE = 'application/pdf';
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 var Svc = {};
 XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
                                    '@mozilla.org/mime;1',
                                    'nsIMIMEService');
 XPCOMUtils.defineLazyServiceGetter(Svc, 'pluginHost',
                                    '@mozilla.org/plugin/host;1',
                                    'nsIPluginHost');
--- a/browser/extensions/pdfjs/content/PdfJsTelemetry.jsm
+++ b/browser/extensions/pdfjs/content/PdfJsTelemetry.jsm
@@ -15,17 +15,17 @@
 /* jshint esnext:true, maxlen: 100 */
 /* globals Components, Services */
 
 'use strict';
 
 this.EXPORTED_SYMBOLS = ['PdfJsTelemetry'];
 
 const Cu = Components.utils;
-Cu.import('resource://gre/modules/Services.jsm');
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 this.PdfJsTelemetry = {
   onViewerIsUsed: function () {
     let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_USED');
     histogram.add(true);
   },
   onFallback: function () {
     let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FALLBACK_SHOWN');
--- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
+++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ -28,19 +28,19 @@ const Cu = Components.utils;
 const MOZ_CENTRAL = JSON.parse('true');
 const PDFJS_EVENT_ID = 'pdf.js.message';
 const PDF_CONTENT_TYPE = 'application/pdf';
 const PREF_PREFIX = 'pdfjs';
 const PDF_VIEWER_WEB_PAGE = 'resource://pdf.js/web/viewer.html';
 const MAX_NUMBER_OF_PREFS = 50;
 const MAX_STRING_PREF_LENGTH = 128;
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/NetUtil.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
+let { NetUtil } = Cu.import('resource://gre/modules/NetUtil.jsm', {});
 
 XPCOMUtils.defineLazyModuleGetter(this, 'NetworkManager',
   'resource://pdf.js/PdfJsNetwork.jsm');
 
 XPCOMUtils.defineLazyModuleGetter(this, 'PrivateBrowsingUtils',
   'resource://gre/modules/PrivateBrowsingUtils.jsm');
 
 XPCOMUtils.defineLazyModuleGetter(this, 'PdfJsTelemetry',
--- a/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm
+++ b/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm
@@ -22,18 +22,18 @@ var EXPORTED_SYMBOLS = ['PdfjsChromeUtil
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 const PREF_PREFIX = 'pdfjs';
 const PDF_CONTENT_TYPE = 'application/pdf';
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 var Svc = {};
 XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
                                    '@mozilla.org/mime;1',
                                    'nsIMIMEService');
 
 var DEFAULT_PREFERENCES =
 {
--- a/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm
+++ b/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm
@@ -20,17 +20,17 @@
 var EXPORTED_SYMBOLS = ['PdfjsContentUtils'];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 var PdfjsContentUtils = {
   _mm: null,
 
   /*
    * Public API
    */
 
--- a/browser/extensions/pocket/bootstrap.js
+++ b/browser/extensions/pocket/bootstrap.js
@@ -1,16 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, manager: Cm} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://gre/modules/Preferences.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
                                   "resource:///modules/RecentWindow.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
                                   "resource:///modules/CustomizableUI.jsm");
--- a/browser/extensions/pocket/content/AboutPocket.jsm
+++ b/browser/extensions/pocket/content/AboutPocket.jsm
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { interfaces: Ci, results: Cr, manager: Cm, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 // See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
 const PREF_LOG_LEVEL = "loop.debug.loglevel";
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
     maxLogLevelPref: PREF_LOG_LEVEL,
--- a/browser/extensions/pocket/content/Pocket.jsm
+++ b/browser/extensions/pocket/content/Pocket.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = ["Pocket"];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
   "resource://gre/modules/ReaderMode.jsm");
 
 var Pocket = {
   get site() { return Services.prefs.getCharPref("extensions.pocket.site"); },
--- a/browser/extensions/pocket/content/main.js
+++ b/browser/extensions/pocket/content/main.js
@@ -1,52 +1,9 @@
-/*
- * LICENSE
- *
- * POCKET MARKS
- *
- * Notwithstanding the permitted uses of the Software (as defined below) pursuant to the license set forth below, "Pocket," "Read It Later" and the Pocket icon and logos (collectively, the “Pocket Marks”) are registered and common law trademarks of Read It Later, Inc. This means that, while you have considerable freedom to redistribute and modify the Software, there are tight restrictions on your ability to use the Pocket Marks. This license does not grant you any rights to use the Pocket Marks except as they are embodied in the Software.
- *
- * ---
- *
- * SOFTWARE
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/*
- * Pocket UI module
- *
- * Handles interactions with Pocket buttons, panels and menus.
- *
- */
-
-// TODO : Get the toolbar icons from Firefox's build (Nikki needs to give us a red saved icon)
-// TODO : [needs clarificaiton from Fx] Firefox's plan was to hide Pocket from context menus until the user logs in. Now that it's an extension I'm wondering if we still need to do this.
-// TODO : [needs clarificaiton from Fx] Reader mode (might be a something they need to do since it's in html, need to investigate their code)
-// TODO : [needs clarificaiton from Fx] Move prefs within pktApi.s to sqlite or a local file so it's not editable (and is safer)
-// TODO : [nice to have] - Immediately save, buffer the actions in a local queue and send (so it works offline, works like our native extensions)
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
   "resource://gre/modules/ReaderMode.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "pktApi",
   "chrome://pocket/content/pktApi.jsm");
 
 var pktUI = (function() {
--- a/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
+++ b/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
@@ -1,944 +1,944 @@
-/*
- * jQuery Plugin: Tokenizing Autocomplete Text Entry
- * Version 1.6.0
- *
- * Copyright (c) 2009 James Smith (http://loopj.com)
- * Licensed jointly under the GPL and MIT licenses,
- * choose which one suits your project best!
- *
- * Licensed under MIT
- * With modifications
- *
- */
-
-(function ($) {
-// Default settings
-var DEFAULT_SETTINGS = {
- // Search settings
-    method: "GET",
-    contentType: "json",
-    queryParam: "q",
-    searchDelay: 300,
-    minChars: 1,
-    propertyToSearch: "name",
-    jsonContainer: null,
-    scrollKeyboard: false,
-
- // Display settings
-    hintText: null,
-    noResultsText: null,
-    noResultsHideDropdown: false,
-    searchingText: null,
-    deleteText: "&times;",
-    animateDropdown: true,
-    emptyInputLength: null,
-
- // Tokenization settings
-    tokenLimit: null,
-    tokenDelimiter: ",",
-    preventDuplicates: false,
-
- // Output settings
-    tokenValue: "id",
-
- // Prepopulation settings
-    prePopulate: null,
-    processPrePopulate: false,
-
- // Manipulation settings
-    idPrefix: "token-input-",
-
- // Formatters
-    resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
-    tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
-
-    // Validations
-    validateItem: null,
-
-    // Force selections only on mouse click
-    noHoverSelect: false,
-
- // Callbacks
-    onResult: null,
-    onAdd: null,
-    onDelete: null,
-    onReady: null
-};
-
-// Default classes to use when theming
-var DEFAULT_CLASSES = {
-    tokenList: "token-input-list",
-    token: "token-input-token",
-    tokenDelete: "token-input-delete-token",
-    selectedToken: "token-input-selected-token",
-    highlightedToken: "token-input-highlighted-token",
-    dropdown: "token-input-dropdown",
-    dropdownItem: "token-input-dropdown-item",
-    dropdownItem2: "token-input-dropdown-item2",
-    selectedDropdownItem: "token-input-selected-dropdown-item",
-    inputToken: "token-input-input-token"
-};
-
-// Input box position "enum"
-var POSITION = {
-    BEFORE: 0,
-    AFTER: 1,
-    END: 2
-};
-
-// Keys "enum"
-var KEY = {
-    BACKSPACE: 8,
-    TAB: 9,
-    ENTER: 13,
-    ESCAPE: 27,
-    SPACE: 32,
-    PAGE_UP: 33,
-    PAGE_DOWN: 34,
-    END: 35,
-    HOME: 36,
-    LEFT: 37,
-    UP: 38,
-    RIGHT: 39,
-    DOWN: 40,
-    NUMPAD_ENTER: 108,
-    COMMA: 188
-};
-
-// Additional public (exposed) methods
-var methods = {
-    init: function(url_or_data_or_function, options) {
-        var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
-
-        return this.each(function () {
-            $(this).data("tokenInputObject", new $.TokenList(this, url_or_data_or_function, settings));
-        });
-    },
-    clear: function() {
-        this.data("tokenInputObject").clear();
-        return this;
-    },
-    add: function(item) {
-        this.data("tokenInputObject").add(item);
-        return this;
-    },
-    remove: function(item) {
-        this.data("tokenInputObject").remove(item);
-        return this;
-    },
-    get: function() {
-     return this.data("tokenInputObject").getTokens();
-     }
-}
-
-// Expose the .tokenInput function to jQuery as a plugin
-$.fn.tokenInput = function (method) {
-    // Method calling and initialization logic
-    if(methods[method]) {
-        return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
-    } else {
-        return methods.init.apply(this, arguments);
-    }
-};
-
-// TokenList class for each input
-$.TokenList = function (input, url_or_data, settings) {
-    //
-    // Initialization
-    //
-
-    // Configure the data source
-    if($.type(url_or_data) === "string" || $.type(url_or_data) === "function") {
-        // Set the url to query against
-        settings.url = url_or_data;
-
-        // If the URL is a function, evaluate it here to do our initalization work
-        var url = computeURL();
-
-        // Make a smart guess about cross-domain if it wasn't explicitly specified
-        if(settings.crossDomain === undefined) {
-            if(url.indexOf("://") === -1) {
-                settings.crossDomain = false;
-            } else {
-                settings.crossDomain = (location.href.split(/\/+/g)[1] !== url.split(/\/+/g)[1]);
-            }
-        }
-    } else if(typeof(url_or_data) === "object") {
-        // Set the local data to search through
-        settings.local_data = url_or_data;
-    }
-
-    // Build class names
-    if(settings.classes) {
-        // Use custom class names
-        settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
-    } else if(settings.theme) {
-        // Use theme-suffixed default class names
-        settings.classes = {};
-        $.each(DEFAULT_CLASSES, function(key, value) {
-            settings.classes[key] = value + "-" + settings.theme;
-        });
-    } else {
-        settings.classes = DEFAULT_CLASSES;
-    }
-
-
-    // Save the tokens
-    var saved_tokens = [];
-
-    // Keep track of the number of tokens in the list
-    var token_count = 0;
-
-    // Basic cache to save on db hits
-    var cache = new $.TokenList.Cache();
-
-    // Keep track of the timeout, old vals
-    var timeout;
-    var input_val;
-
-    function tokenize(){
-        var item = $(selected_dropdown_item).data("tokeninput");
-        if(!item && settings.textToData){
-            item = settings.textToData(input_box.val());
-        }
-
-        if(item) {
-            add_token(item);
-            hidden_input.change();
-            return false;
-        }
-    }
-
-    // Create a new text input an attach keyup events
-    var input_box = $("<input type=\"text\"  autocomplete=\"off\">")
-        .css({
-            outline: "none"
-        })
-        .attr("id", settings.idPrefix + input.id)
-        .focus(function () {
-            if (settings.minChars == 0) {
-                setTimeout(function(){do_search();}, 5);
-            }
-            if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
-                show_dropdown_hint();
-            }
-        })
-        .blur(function () {
-            tokenize();
-            hide_dropdown();
-            $(this).val("");
-        })
-        .bind("keyup keydown blur update", resize_input)
-        .keydown(function (event) {
-            var previous_token;
-            var next_token;
-
-            switch(event.keyCode) {
-                case KEY.LEFT:
-                case KEY.RIGHT:
-                case KEY.UP:
-                case KEY.DOWN:
-                    if(!$(this).val()) {
-                        previous_token = input_token.prev();
-                        next_token = input_token.next();
-
-                        if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
-                            // Check if there is a previous/next token and it is selected
-                            if(event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
-                                deselect_token($(selected_token), POSITION.BEFORE);
-                            } else {
-                                deselect_token($(selected_token), POSITION.AFTER);
-                            }
-                        } else if((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
-                            // We are moving left, select the previous token if it exists
-                            select_token($(previous_token.get(0)));
-                        } else if((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
-                            // We are moving right, select the next token if it exists
-                            select_token($(next_token.get(0)));
-                        }
-                    } else {
-                        if (event.keyCode === KEY.UP || event.keyCode === KEY.DOWN) {
-                            var dropdown_item = null;
-                            if(!selected_dropdown_item && (event.keyCode === KEY.DOWN)) {
-                                dropdown_item = $('.token-input-dropdown li').first();
-                            }
-                            else if(event.keyCode === KEY.DOWN) {
-                                dropdown_item = $(selected_dropdown_item).next();
-                            } else {
-                                dropdown_item = $(selected_dropdown_item).prev();
-                            }
-
-                            if(dropdown_item.length) {
-                                select_dropdown_item(dropdown_item,true);
-                            }
-                            else if (!(event.keyCode === KEY.DOWN) && $(selected_dropdown_item).length) {
-                                deselect_dropdown_item($(selected_dropdown_item));
-                            }
-                            return false;
-                        }
-                    }
-                    break;
-
-                case KEY.BACKSPACE:
-                    previous_token = input_token.prev();
-
-                    if(!$(this).val().length) {
-                        if(selected_token) {
-                            delete_token($(selected_token));
-                            hidden_input.change();
-                        } else if(previous_token.length) {
-                            select_token($(previous_token.get(0)));
-                        }
-
-                        return false;
-                    } else if($(this).val().length === 1) {
-                        hide_dropdown();
-                    } else {
-                        // set a timeout just long enough to let this function finish.
-                        setTimeout(function(){do_search();}, 5);
-                    }
-                    break;
-
-                case KEY.TAB:
-                case KEY.ENTER:
-                case KEY.NUMPAD_ENTER:
-                case KEY.COMMA:
-                    if (event.keyCode != KEY.ENTER && event.keyCode != KEY.NUMPAD_ENTER)
-                    {
-                        event.preventDefault();
-                    }
-                    tokenize();
-                  break;
-
-                case KEY.ESCAPE:
-                  hide_dropdown();
-                  return true;
-
-                default:
-                    if(String.fromCharCode(event.which)) {
-                        // set a timeout just long enough to let this function finish.
-                        setTimeout(function(){do_search();}, 5);
-                    }
-                    break;
-            }
-        });
-
-    // Keep a reference to the original input box
-    var hidden_input = $(input)
-                           .hide()
-                           .val("")
-                           .focus(function () {
-                               input_box.focus();
-                           })
-                           .blur(function () {
-                               input_box.blur();
-                           });
-
-    // Keep a reference to the selected token and dropdown item
-    var selected_token = null;
-    var selected_token_index = 0;
-    var selected_dropdown_item = null;
-
-    // The list to store the token items in
-    var token_list = $("<ul />")
-        .addClass(settings.classes.tokenList)
-        .click(function (event) {
-            var li = $(event.target).closest("li");
-            if(li && li.get(0) && $.data(li.get(0), "tokeninput")) {
-                toggle_select_token(li);
-            } else {
-                // Deselect selected token
-                if(selected_token) {
-                    deselect_token($(selected_token), POSITION.END);
-                }
-
-                // Focus input box
-                input_box.focus();
-            }
-        })
-        .mouseover(function (event) {
-            var li = $(event.target).closest("li");
-            if(li && selected_token !== this) {
-                li.addClass(settings.classes.highlightedToken);
-            }
-        })
-        .mouseout(function (event) {
-            var li = $(event.target).closest("li");
-            if(li && selected_token !== this) {
-                li.removeClass(settings.classes.highlightedToken);
-            }
-        })
-        .insertBefore(hidden_input);
-
-    // The token holding the input box
-    var input_token = $("<li />")
-        .addClass(settings.classes.inputToken)
-        .appendTo(token_list)
-        .append(input_box);
-
-    // The list to store the dropdown items in
-    var dropdown = $("<div>")
-        .addClass(settings.classes.dropdown)
-        .appendTo("body")
-        .hide();
-
-    // Magic element to help us resize the text input
-    var input_resizer = $("<tester/>")
-        .insertAfter(input_box)
-        .css({
-            position: "absolute",
-            top: -9999,
-            left: -9999,
-            width: "auto",
-            fontSize: input_box.css("fontSize"),
-            fontFamily: input_box.css("fontFamily"),
-            fontWeight: input_box.css("fontWeight"),
-            letterSpacing: input_box.css("letterSpacing"),
-            whiteSpace: "nowrap"
-        });
-
-    // Pre-populate list if items exist
-    hidden_input.val("");
-    var li_data = settings.prePopulate || hidden_input.data("pre");
-    if(settings.processPrePopulate && $.isFunction(settings.onResult)) {
-        li_data = settings.onResult.call(hidden_input, li_data);
-    }
-    if(li_data && li_data.length) {
-        $.each(li_data, function (index, value) {
-            insert_token(value);
-            checkTokenLimit();
-        });
-    }
-
-    // Initialization is done
-    if($.isFunction(settings.onReady)) {
-        settings.onReady.call();
-        if (settings.minChars == 0)
-        {
-            setTimeout(function(){do_search();}, 5);
-        }
-    }
-
-    //
-    // Public functions
-    //
-
-    this.clear = function() {
-        token_list.children("li").each(function() {
-            if ($(this).children("input").length === 0) {
-                delete_token($(this));
-            }
-        });
-    }
-
-    this.add = function(item) {
-        add_token(item);
-    }
-
-    this.remove = function(item) {
-        token_list.children("li").each(function() {
-            if ($(this).children("input").length === 0) {
-                var currToken = $(this).data("tokeninput");
-                var match = true;
-                for (var prop in item) {
-                    if (item[prop] !== currToken[prop]) {
-                        match = false;
-                        break;
-                    }
-                }
-                if (match) {
-                    delete_token($(this));
-                }
-            }
-        });
-    }
-    
-    this.getTokens = function() {
-       return saved_tokens;
-     }
-
-    //
-    // Private functions
-    //
-
-    function checkTokenLimit() {
-        if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
-            input_box.hide();
-            hide_dropdown();
-            return;
-        }
-    }
-
-    function resize_input() {
-        if(input_val === (input_val = input_box.val())) {return;}
-
-        // Enter new content into resizer and resize input accordingly
-        var escaped = input_val.replace(/&/g, '&amp;').replace(/\s/g,' ').replace(/</g, '&lt;').replace(/>/g, '&gt;');
-        input_resizer.html(escaped);
-        var minwidth = 30;
-        if (settings.emptyInputLength && token_list.children().length < 2) {
-            minwidth = settings.emptyInputLength;
-        }
-        input_box.width(input_resizer.width() + minwidth);
-    }
-
-    function is_printable_character(keycode) {
-        return ((keycode >= 48 && keycode <= 90) ||     // 0-1a-z
-                (keycode >= 96 && keycode <= 111) ||    // numpad 0-9 + - / * .
-                (keycode >= 186 && keycode <= 192) ||   // ; = , - . / ^
-                (keycode >= 219 && keycode <= 222));    // ( \ ) '
-    }
-
-    // Inner function to a token to the list
-    function insert_token(item) {
-        var this_token = settings.tokenFormatter(item);
-        this_token = $(this_token)
-          .addClass(settings.classes.token)
-          .insertBefore(input_token);
-
-        // The 'delete token' button
-        $("<span>" + settings.deleteText + "</span>")
-            .addClass(settings.classes.tokenDelete)
-            .appendTo(this_token)
-            .click(function () {
-                delete_token($(this).parent());
-                hidden_input.change();
-                return false;
-            });
-
-        // Store data on the token
-        var token_data = {"id": item.id};
-        token_data[settings.propertyToSearch] = item[settings.propertyToSearch];
-        token_data.item = item;
-        $.data(this_token.get(0), "tokeninput", item);
-
-        // Save this token for duplicate checking
-        saved_tokens = saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
-        selected_token_index++;
-
-        // Update the hidden input
-        update_hidden_input(saved_tokens, hidden_input);
-
-        token_count += 1;
-
-        // Check the token limit
-        if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
-            input_box.hide();
-            hide_dropdown();
-        }
-
-        return this_token;
-    }
-
-    // Add a token to the token list based on user input
-    function add_token (item) {
-        if(!item) return;
-
-        // Check for item validation
-        if ($.isFunction(settings.validateItem) && !settings.validateItem(item)) {
-            return false;
-        }
-
-        var callback = settings.onAdd;
-
-        // See if the token already exists and select it if we don't want duplicates
-        if(token_count > 0 && settings.preventDuplicates) {
-            var found_existing_token = null;
-            token_list.children().each(function () {
-                var existing_token = $(this);
-                var existing_data = $.data(existing_token.get(0), "tokeninput");
-                if(existing_data && existing_data.id === item.id) {
-                    found_existing_token = existing_token;
-                    return false;
-                }
-            });
-
-            if(found_existing_token) {
-                select_token(found_existing_token);
-                input_token.insertAfter(found_existing_token);
-                input_box.focus();
-                return;
-            }
-        }
-
-        // Insert the new tokens
-        if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
-            insert_token(item);
-            checkTokenLimit();
-        }
-
-        // Clear input box
-        input_box.val("");
-
-        // Don't show the help dropdown, they've got the idea
-        hide_dropdown();
-
-        // Execute the onAdd callback if defined
-        if($.isFunction(callback)) {
-            callback.call(hidden_input,item);
-        }
-    }
-
-    // Select a token in the token list
-    function select_token (token) {
-        token.addClass(settings.classes.selectedToken);
-        selected_token = token.get(0);
-
-        // Hide input box
-        input_box.val("");
-
-        // Hide dropdown if it is visible (eg if we clicked to select token)
-        hide_dropdown();
-    }
-
-    // Deselect a token in the token list
-    function deselect_token (token, position) {
-        token.removeClass(settings.classes.selectedToken);
-        selected_token = null;
-
-        if(position === POSITION.BEFORE) {
-            input_token.insertBefore(token);
-            selected_token_index--;
-        } else if(position === POSITION.AFTER) {
-            input_token.insertAfter(token);
-            selected_token_index++;
-        } else {
-            input_token.appendTo(token_list);
-            selected_token_index = token_count;
-        }
-
-        // Show the input box and give it focus again
-        input_box.focus();
-    }
-
-    // Toggle selection of a token in the token list
-    function toggle_select_token(token) {
-        var previous_selected_token = selected_token;
-
-        if(selected_token) {
-            deselect_token($(selected_token), POSITION.END);
-        }
-
-        if(previous_selected_token === token.get(0)) {
-            deselect_token(token, POSITION.END);
-        } else {
-            select_token(token);
-        }
-    }
-
-    // Delete a token from the token list
-    function delete_token (token) {
-        // Remove the id from the saved list
-        var token_data = $.data(token.get(0), "tokeninput");
-        var callback = settings.onDelete;
-
-        var index = token.prevAll().length;
-        if(index > selected_token_index) index--;
-
-        // Delete the token
-        token.remove();
-        selected_token = null;
-
-        // Show the input box and give it focus again
-        input_box.focus();
-
-        // Remove this token from the saved list
-        saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
-        if(index < selected_token_index) selected_token_index--;
-
-        // Update the hidden input
-        update_hidden_input(saved_tokens, hidden_input);
-
-        token_count -= 1;
-
-        if(settings.tokenLimit !== null) {
-            input_box
-                .show()
-                .val("")
-                .focus();
-        }
-
-        // Execute the onDelete callback if defined
-        if($.isFunction(callback)) {
-            callback.call(hidden_input,token_data);
-        }
-    }
-
-    // Update the hidden input box value
-    function update_hidden_input(saved_tokens, hidden_input) {
-        var token_values = $.map(saved_tokens, function (el) {
-            return el[settings.tokenValue];
-        });
-        hidden_input.val(token_values.join(settings.tokenDelimiter));
-
-    }
-
-    // Hide and clear the results dropdown
-    function hide_dropdown () {
-        dropdown.hide().empty();
-        selected_dropdown_item = null;
-        if (settings.onHideDropdown)
-         settings.onHideDropdown();
-    }
-
-    function show_dropdown() {
-        dropdown
-            .css({
-                position: "absolute",
-                top: $(token_list).offset().top + $(token_list).outerHeight(),
-                left: $(token_list).offset().left,
-                zindex: 999
-            })
-            .show();
-        if (settings.onShowDropdown)
-         settings.onShowDropdown();
-    }
-
-    function show_dropdown_searching () {
-        if(settings.searchingText) {
-            dropdown.html("<p>"+settings.searchingText+"</p>");
-            show_dropdown();
-        }
-    }
-
-    function show_dropdown_hint () {
-        if(settings.hintText) {
-            dropdown.html("<p>"+settings.hintText+"</p>");
-            show_dropdown();
-        }
-    }
-
-    // Highlight the query part of the search term
-    function highlight_term(value, term) {
-        return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
-    }
-    
-    function find_value_and_highlight_term(template, value, term) {
-        return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + value + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term));
-    }
-
-    // Populate the results dropdown with some results
-    function populate_dropdown (query, results) {
-        if(results && results.length) {
-            dropdown.empty();
-            var dropdown_ul = $("<ul>")
-                .appendTo(dropdown)
-                .mouseover(function (event) {
-                    select_dropdown_item($(event.target).closest("li"));
-                })
-                .mousedown(function (event) {
-                    add_token($(event.target).closest("li").data("tokeninput"));
-                    hidden_input.change();
-                    return false;
-                })
-                .hide();
-            if (settings.noHoverSelect) {
-                dropdown_ul.off('mouseover');
-                dropdown_ul.on('mouseover',function (event) {
-                    $(this).find("li").removeClass(settings.classes.selectedDropdownItem);
-                    $(event.target).closest("li").addClass(settings.classes.selectedDropdownItem);
-                });
-            }
-
-            $.each(results, function(index, value) {
-                var this_li = settings.resultsFormatter(value);
-                
-                // this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);            
-                
-                this_li = $(this_li).appendTo(dropdown_ul);
-                
-                if(index % 2) {
-                    this_li.addClass(settings.classes.dropdownItem);
-                } else {
-                    this_li.addClass(settings.classes.dropdownItem2);
-                }
-
-                // if(index === 0) {
-                //     select_dropdown_item(this_li);
-                // }
-
-                $.data(this_li.get(0), "tokeninput", value);
-            });
-
-            show_dropdown();
-
-            if(settings.animateDropdown) {
-                dropdown_ul.slideDown("fast");
-            } else {
-                dropdown_ul.show();
-            }
-        } else {
-            if(settings.noResultsText) {
-                dropdown.html("<p>"+settings.noResultsText+"</p>");
-                show_dropdown();
-            }
-            if (settings.noResultsHideDropdown) {
-                hide_dropdown();
-            }
-        }
-    }
-
-    // Highlight an item in the results dropdown
-    function select_dropdown_item (item,withkeyboard) {
-        if(item) {
-            if(selected_dropdown_item) {
-                deselect_dropdown_item($(selected_dropdown_item));
-            }
-            if (settings.scrollKeyboard && withkeyboard) {
-                var list = $('.token-input-dropdown-tag ul');
-                var listheight = list.height();
-                var itemheight = item.outerHeight();
-                var itemtop = item.position().top;
-                if (itemtop > listheight) {
-                    var listscroll = list.scrollTop();
-                    list.scrollTop(listscroll + itemheight);
-                }
-                else if (itemtop < 0) {
-                    var listscroll = list.scrollTop();
-                    list.scrollTop(listscroll - itemheight);
-                }
-
-            }
-            item.addClass(settings.classes.selectedDropdownItem);
-            selected_dropdown_item = item.get(0);
-        }
-    }
-
-    // Remove highlighting from an item in the results dropdown
-    function deselect_dropdown_item (item) {
-        item.removeClass(settings.classes.selectedDropdownItem);
-        selected_dropdown_item = null;
-    }
-
-    // Do a search and show the "searching" dropdown if the input is longer
-    // than settings.minChars
-    function do_search() {
-        var query = input_box.val().toLowerCase();
-        if(query && query.length || settings.minChars == 0) {
-            if(selected_token) {
-                deselect_token($(selected_token), POSITION.AFTER);
-            }
-
-            if(query.length >= settings.minChars) {
-                show_dropdown_searching();
-                clearTimeout(timeout);
-
-                timeout = setTimeout(function(){
-                    run_search(query);
-                }, settings.searchDelay);
-            } else {
-                hide_dropdown();
-            }
-        }
-    }
-
-    // Do the actual search
-    function run_search(query) {
-        var cache_key = query + computeURL();
-        var cached_results = cache.get(cache_key);
-        if(cached_results) {
-            populate_dropdown(query, cached_results);
-        } else {
-            // Are we doing an ajax search or local data search?
-            if(settings.url) {
-                var url = computeURL();
-                // Extract exisiting get params
-                var ajax_params = {};
-                ajax_params.data = {};
-                if(url.indexOf("?") > -1) {
-                    var parts = url.split("?");
-                    ajax_params.url = parts[0];
-
-                    var param_array = parts[1].split("&");
-                    $.each(param_array, function (index, value) {
-                        var kv = value.split("=");
-                        ajax_params.data[kv[0]] = kv[1];
-                    });
-                } else {
-                    ajax_params.url = url;
-                }
-
-                // Prepare the request
-                ajax_params.data[settings.queryParam] = query;
-                ajax_params.type = settings.method;
-                ajax_params.dataType = settings.contentType;
-                if(settings.crossDomain) {
-                    ajax_params.dataType = "jsonp";
-                }
-
-                // Attach the success callback
-                ajax_params.success = function(results) {
-                  if($.isFunction(settings.onResult)) {
-                      results = settings.onResult.call(hidden_input, results);
-                  }
-                  cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);
-
-                  // only populate the dropdown if the results are associated with the active search query
-                  if(input_box.val().toLowerCase() === query) {
-                      populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
-                  }
-                };
-
-                // Make the request
-                $.ajax(ajax_params);
-            } else if(settings.search_function){
-                settings.search_function(query, function(results){
-                    cache.add(cache_key, results);
-                    populate_dropdown(query, results);
-                });
-            } else if(settings.local_data) {
-                // Do the search through local data
-                var results = $.grep(settings.local_data, function (row) {
-                    return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
-                });
-
-                if($.isFunction(settings.onResult)) {
-                    results = settings.onResult.call(hidden_input, results);
-                }
-                cache.add(cache_key, results);
-                populate_dropdown(query, results);
-            }
-        }
-    }
-
-    // compute the dynamic URL
-    function computeURL() {
-        var url = settings.url;
-        if(typeof settings.url == 'function') {
-            url = settings.url.call();
-        }
-        return url;
-    }
-};
-
-// Really basic cache for the results
-$.TokenList.Cache = function (options) {
-    var settings = $.extend({
-        max_size: 500
-    }, options);
-
-    var data = {};
-    var size = 0;
-
-    var flush = function () {
-        data = {};
-        size = 0;
-    };
-
-    this.add = function (query, results) {
-        if(size > settings.max_size) {
-            flush();
-        }
-
-        if(!data[query]) {
-            size += 1;
-        }
-
-        data[query] = results;
-    };
-
-    this.get = function (query) {
-        return data[query];
-    };
-};
-}(jQuery));
+/*
+ * jQuery Plugin: Tokenizing Autocomplete Text Entry
+ * Version 1.6.0
+ *
+ * Copyright (c) 2009 James Smith (http://loopj.com)
+ * Licensed jointly under the GPL and MIT licenses,
+ * choose which one suits your project best!
+ *
+ * Licensed under MIT
+ * With modifications
+ *
+ */
+
+(function ($) {
+// Default settings
+var DEFAULT_SETTINGS = {
+ // Search settings
+    method: "GET",
+    contentType: "json",
+    queryParam: "q",
+    searchDelay: 300,
+    minChars: 1,
+    propertyToSearch: "name",
+    jsonContainer: null,
+    scrollKeyboard: false,
+
+ // Display settings
+    hintText: null,
+    noResultsText: null,
+    noResultsHideDropdown: false,
+    searchingText: null,
+    deleteText: "&times;",
+    animateDropdown: true,
+    emptyInputLength: null,
+
+ // Tokenization settings
+    tokenLimit: null,
+    tokenDelimiter: ",",
+    preventDuplicates: false,
+
+ // Output settings
+    tokenValue: "id",
+
+ // Prepopulation settings
+    prePopulate: null,
+    processPrePopulate: false,
+
+ // Manipulation settings
+    idPrefix: "token-input-",
+
+ // Formatters
+    resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
+    tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
+
+    // Validations
+    validateItem: null,
+
+    // Force selections only on mouse click
+    noHoverSelect: false,
+
+ // Callbacks
+    onResult: null,
+    onAdd: null,
+    onDelete: null,
+    onReady: null
+};
+
+// Default classes to use when theming
+var DEFAULT_CLASSES = {
+    tokenList: "token-input-list",
+    token: "token-input-token",
+    tokenDelete: "token-input-delete-token",
+    selectedToken: "token-input-selected-token",
+    highlightedToken: "token-input-highlighted-token",
+    dropdown: "token-input-dropdown",
+    dropdownItem: "token-input-dropdown-item",
+    dropdownItem2: "token-input-dropdown-item2",
+    selectedDropdownItem: "token-input-selected-dropdown-item",
+    inputToken: "token-input-input-token"
+};
+
+// Input box position "enum"
+var POSITION = {
+    BEFORE: 0,
+    AFTER: 1,
+    END: 2
+};
+
+// Keys "enum"
+var KEY = {
+    BACKSPACE: 8,
+    TAB: 9,
+    ENTER: 13,
+    ESCAPE: 27,
+    SPACE: 32,
+    PAGE_UP: 33,
+    PAGE_DOWN: 34,
+    END: 35,
+    HOME: 36,
+    LEFT: 37,
+    UP: 38,
+    RIGHT: 39,
+    DOWN: 40,
+    NUMPAD_ENTER: 108,
+    COMMA: 188
+};
+
+// Additional public (exposed) methods
+var methods = {
+    init: function(url_or_data_or_function, options) {
+        var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
+
+        return this.each(function () {
+            $(this).data("tokenInputObject", new $.TokenList(this, url_or_data_or_function, settings));
+        });
+    },
+    clear: function() {
+        this.data("tokenInputObject").clear();
+        return this;
+    },
+    add: function(item) {
+        this.data("tokenInputObject").add(item);
+        return this;
+    },
+    remove: function(item) {
+        this.data("tokenInputObject").remove(item);
+        return this;
+    },
+    get: function() {
+     return this.data("tokenInputObject").getTokens();
+     }
+}
+
+// Expose the .tokenInput function to jQuery as a plugin
+$.fn.tokenInput = function (method) {
+    // Method calling and initialization logic
+    if(methods[method]) {
+        return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+    } else {
+        return methods.init.apply(this, arguments);
+    }
+};
+
+// TokenList class for each input
+$.TokenList = function (input, url_or_data, settings) {
+    //
+    // Initialization
+    //
+
+    // Configure the data source
+    if($.type(url_or_data) === "string" || $.type(url_or_data) === "function") {
+        // Set the url to query against
+        settings.url = url_or_data;
+
+        // If the URL is a function, evaluate it here to do our initalization work
+        var url = computeURL();
+
+        // Make a smart guess about cross-domain if it wasn't explicitly specified
+        if(settings.crossDomain === undefined) {
+            if(url.indexOf("://") === -1) {
+                settings.crossDomain = false;
+            } else {
+                settings.crossDomain = (location.href.split(/\/+/g)[1] !== url.split(/\/+/g)[1]);
+            }
+        }
+    } else if(typeof(url_or_data) === "object") {
+        // Set the local data to search through
+        settings.local_data = url_or_data;
+    }
+
+    // Build class names
+    if(settings.classes) {
+        // Use custom class names
+        settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
+    } else if(settings.theme) {
+        // Use theme-suffixed default class names
+        settings.classes = {};
+        $.each(DEFAULT_CLASSES, function(key, value) {
+            settings.classes[key] = value + "-" + settings.theme;
+        });
+    } else {
+        settings.classes = DEFAULT_CLASSES;
+    }
+
+
+    // Save the tokens
+    var saved_tokens = [];
+
+    // Keep track of the number of tokens in the list
+    var token_count = 0;
+
+    // Basic cache to save on db hits
+    var cache = new $.TokenList.Cache();
+
+    // Keep track of the timeout, old vals
+    var timeout;
+    var input_val;
+
+    function tokenize(){
+        var item = $(selected_dropdown_item).data("tokeninput");
+        if(!item && settings.textToData){
+            item = settings.textToData(input_box.val());
+        }
+
+        if(item) {
+            add_token(item);
+            hidden_input.change();
+            return false;
+        }
+    }
+
+    // Create a new text input an attach keyup events
+    var input_box = $("<input type=\"text\"  autocomplete=\"off\">")
+        .css({
+            outline: "none"
+        })
+        .attr("id", settings.idPrefix + input.id)
+        .focus(function () {
+            if (settings.minChars == 0) {
+                setTimeout(function(){do_search();}, 5);
+            }
+            if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
+                show_dropdown_hint();
+            }
+        })
+        .blur(function () {
+            tokenize();
+            hide_dropdown();
+            $(this).val("");
+        })
+        .bind("keyup keydown blur update", resize_input)
+        .keydown(function (event) {
+            var previous_token;
+            var next_token;
+
+            switch(event.keyCode) {
+                case KEY.LEFT:
+                case KEY.RIGHT:
+                case KEY.UP:
+                case KEY.DOWN:
+                    if(!$(this).val()) {
+                        previous_token = input_token.prev();
+                        next_token = input_token.next();
+
+                        if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
+                            // Check if there is a previous/next token and it is selected
+                            if(event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
+                                deselect_token($(selected_token), POSITION.BEFORE);
+                            } else {
+                                deselect_token($(selected_token), POSITION.AFTER);
+                            }
+                        } else if((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
+                            // We are moving left, select the previous token if it exists
+                            select_token($(previous_token.get(0)));
+                        } else if((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
+                            // We are moving right, select the next token if it exists
+                            select_token($(next_token.get(0)));
+                        }
+                    } else {
+                        if (event.keyCode === KEY.UP || event.keyCode === KEY.DOWN) {
+                            var dropdown_item = null;
+                            if(!selected_dropdown_item && (event.keyCode === KEY.DOWN)) {
+                                dropdown_item = $('.token-input-dropdown li').first();
+                            }
+                            else if(event.keyCode === KEY.DOWN) {
+                                dropdown_item = $(selected_dropdown_item).next();
+                            } else {
+                                dropdown_item = $(selected_dropdown_item).prev();
+                            }
+
+                            if(dropdown_item.length) {
+                                select_dropdown_item(dropdown_item,true);
+                            }
+                            else if (!(event.keyCode === KEY.DOWN) && $(selected_dropdown_item).length) {
+                                deselect_dropdown_item($(selected_dropdown_item));
+                            }
+                            return false;
+                        }
+                    }
+                    break;
+
+                case KEY.BACKSPACE:
+                    previous_token = input_token.prev();
+
+                    if(!$(this).val().length) {
+                        if(selected_token) {
+                            delete_token($(selected_token));
+                            hidden_input.change();
+                        } else if(previous_token.length) {
+                            select_token($(previous_token.get(0)));
+                        }
+
+                        return false;
+                    } else if($(this).val().length === 1) {
+                        hide_dropdown();
+                    } else {
+                        // set a timeout just long enough to let this function finish.
+                        setTimeout(function(){do_search();}, 5);
+                    }
+                    break;
+
+                case KEY.TAB:
+                case KEY.ENTER:
+                case KEY.NUMPAD_ENTER:
+                case KEY.COMMA:
+                    if (event.keyCode != KEY.ENTER && event.keyCode != KEY.NUMPAD_ENTER)
+                    {
+                        event.preventDefault();
+                    }
+                    tokenize();
+                  break;
+
+                case KEY.ESCAPE:
+                  hide_dropdown();
+                  return true;
+
+                default:
+                    if(String.fromCharCode(event.which)) {
+                        // set a timeout just long enough to let this function finish.
+                        setTimeout(function(){do_search();}, 5);
+                    }
+                    break;
+            }
+        });
+
+    // Keep a reference to the original input box
+    var hidden_input = $(input)
+                           .hide()
+                           .val("")
+                           .focus(function () {
+                               input_box.focus();
+                           })
+                           .blur(function () {
+                               input_box.blur();
+                           });
+
+    // Keep a reference to the selected token and dropdown item
+    var selected_token = null;
+    var selected_token_index = 0;
+    var selected_dropdown_item = null;
+
+    // The list to store the token items in
+    var token_list = $("<ul />")
+        .addClass(settings.classes.tokenList)
+        .click(function (event) {
+            var li = $(event.target).closest("li");
+            if(li && li.get(0) && $.data(li.get(0), "tokeninput")) {
+                toggle_select_token(li);
+            } else {
+                // Deselect selected token
+                if(selected_token) {
+                    deselect_token($(selected_token), POSITION.END);
+                }
+
+                // Focus input box
+                input_box.focus();
+            }
+        })
+        .mouseover(function (event) {
+            var li = $(event.target).closest("li");
+            if(li && selected_token !== this) {
+                li.addClass(settings.classes.highlightedToken);
+            }
+        })
+        .mouseout(function (event) {
+            var li = $(event.target).closest("li");
+            if(li && selected_token !== this) {
+                li.removeClass(settings.classes.highlightedToken);
+            }
+        })
+        .insertBefore(hidden_input);
+
+    // The token holding the input box
+    var input_token = $("<li />")
+        .addClass(settings.classes.inputToken)
+        .appendTo(token_list)
+        .append(input_box);
+
+    // The list to store the dropdown items in
+    var dropdown = $("<div>")
+        .addClass(settings.classes.dropdown)
+        .appendTo("body")
+        .hide();
+
+    // Magic element to help us resize the text input
+    var input_resizer = $("<tester/>")
+        .insertAfter(input_box)
+        .css({
+            position: "absolute",
+            top: -9999,
+            left: -9999,
+            width: "auto",
+            fontSize: input_box.css("fontSize"),
+            fontFamily: input_box.css("fontFamily"),
+            fontWeight: input_box.css("fontWeight"),
+            letterSpacing: input_box.css("letterSpacing"),
+            whiteSpace: "nowrap"
+        });
+
+    // Pre-populate list if items exist
+    hidden_input.val("");
+    var li_data = settings.prePopulate || hidden_input.data("pre");
+    if(settings.processPrePopulate && $.isFunction(settings.onResult)) {
+        li_data = settings.onResult.call(hidden_input, li_data);
+    }
+    if(li_data && li_data.length) {
+        $.each(li_data, function (index, value) {
+            insert_token(value);
+            checkTokenLimit();
+        });
+    }
+
+    // Initialization is done
+    if($.isFunction(settings.onReady)) {
+        settings.onReady.call();
+        if (settings.minChars == 0)
+        {
+            setTimeout(function(){do_search();}, 5);
+        }
+    }
+
+    //
+    // Public functions
+    //
+
+    this.clear = function() {
+        token_list.children("li").each(function() {
+            if ($(this).children("input").length === 0) {
+                delete_token($(this));
+            }
+        });
+    }
+
+    this.add = function(item) {
+        add_token(item);
+    }
+
+    this.remove = function(item) {
+        token_list.children("li").each(function() {
+            if ($(this).children("input").length === 0) {
+                var currToken = $(this).data("tokeninput");
+                var match = true;
+                for (var prop in item) {
+                    if (item[prop] !== currToken[prop]) {
+                        match = false;
+                        break;
+                    }
+                }
+                if (match) {
+                    delete_token($(this));
+                }
+            }
+        });
+    }
+    
+    this.getTokens = function() {
+       return saved_tokens;
+     }
+
+    //
+    // Private functions
+    //
+
+    function checkTokenLimit() {
+        if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
+            input_box.hide();
+            hide_dropdown();
+            return;
+        }
+    }
+
+    function resize_input() {
+        if(input_val === (input_val = input_box.val())) {return;}
+
+        // Enter new content into resizer and resize input accordingly
+        var escaped = input_val.replace(/&/g, '&amp;').replace(/\s/g,' ').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+        input_resizer.html(escaped);
+        var minwidth = 30;
+        if (settings.emptyInputLength && token_list.children().length < 2) {
+            minwidth = settings.emptyInputLength;
+        }
+        input_box.width(input_resizer.width() + minwidth);
+    }
+
+    function is_printable_character(keycode) {
+        return ((keycode >= 48 && keycode <= 90) ||     // 0-1a-z
+                (keycode >= 96 && keycode <= 111) ||    // numpad 0-9 + - / * .
+                (keycode >= 186 && keycode <= 192) ||   // ; = , - . / ^
+                (keycode >= 219 && keycode <= 222));    // ( \ ) '
+    }
+
+    // Inner function to a token to the list
+    function insert_token(item) {
+        var this_token = settings.tokenFormatter(item);
+        this_token = $(this_token)
+          .addClass(settings.classes.token)
+          .insertBefore(input_token);
+
+        // The 'delete token' button
+        $("<span>" + settings.deleteText + "</span>")
+            .addClass(settings.classes.tokenDelete)
+            .appendTo(this_token)
+            .click(function () {
+                delete_token($(this).parent());
+                hidden_input.change();
+                return false;
+            });
+
+        // Store data on the token
+        var token_data = {"id": item.id};
+        token_data[settings.propertyToSearch] = item[settings.propertyToSearch];
+        token_data.item = item;
+        $.data(this_token.get(0), "tokeninput", item);
+
+        // Save this token for duplicate checking
+        saved_tokens = saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
+        selected_token_index++;
+
+        // Update the hidden input
+        update_hidden_input(saved_tokens, hidden_input);
+
+        token_count += 1;
+
+        // Check the token limit
+        if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
+            input_box.hide();
+            hide_dropdown();
+        }
+
+        return this_token;
+    }
+
+    // Add a token to the token list based on user input
+    function add_token (item) {
+        if(!item) return;
+
+        // Check for item validation
+        if ($.isFunction(settings.validateItem) && !settings.validateItem(item)) {
+            return false;
+        }
+
+        var callback = settings.onAdd;
+
+        // See if the token already exists and select it if we don't want duplicates
+        if(token_count > 0 && settings.preventDuplicates) {
+            var found_existing_token = null;
+            token_list.children().each(function () {
+                var existing_token = $(this);
+                var existing_data = $.data(existing_token.get(0), "tokeninput");
+                if(existing_data && existing_data.id === item.id) {
+                    found_existing_token = existing_token;
+                    return false;
+                }
+            });
+
+            if(found_existing_token) {
+                select_token(found_existing_token);
+                input_token.insertAfter(found_existing_token);
+                input_box.focus();
+                return;
+            }
+        }
+
+        // Insert the new tokens
+        if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
+            insert_token(item);
+            checkTokenLimit();
+        }
+
+        // Clear input box
+        input_box.val("");
+
+        // Don't show the help dropdown, they've got the idea
+        hide_dropdown();
+
+        // Execute the onAdd callback if defined
+        if($.isFunction(callback)) {
+            callback.call(hidden_input,item);
+        }
+    }
+
+    // Select a token in the token list
+    function select_token (token) {
+        token.addClass(settings.classes.selectedToken);
+        selected_token = token.get(0);
+
+        // Hide input box
+        input_box.val("");
+
+        // Hide dropdown if it is visible (eg if we clicked to select token)
+        hide_dropdown();
+    }
+
+    // Deselect a token in the token list
+    function deselect_token (token, position) {
+        token.removeClass(settings.classes.selectedToken);
+        selected_token = null;
+
+        if(position === POSITION.BEFORE) {
+            input_token.insertBefore(token);
+            selected_token_index--;
+        } else if(position === POSITION.AFTER) {
+            input_token.insertAfter(token);
+            selected_token_index++;
+        } else {
+            input_token.appendTo(token_list);
+            selected_token_index = token_count;
+        }
+
+        // Show the input box and give it focus again
+        input_box.focus();
+    }
+
+    // Toggle selection of a token in the token list
+    function toggle_select_token(token) {
+        var previous_selected_token = selected_token;
+
+        if(selected_token) {
+            deselect_token($(selected_token), POSITION.END);
+        }
+
+        if(previous_selected_token === token.get(0)) {
+            deselect_token(token, POSITION.END);
+        } else {
+            select_token(token);
+        }
+    }
+
+    // Delete a token from the token list
+    function delete_token (token) {
+        // Remove the id from the saved list
+        var token_data = $.data(token.get(0), "tokeninput");
+        var callback = settings.onDelete;
+
+        var index = token.prevAll().length;
+        if(index > selected_token_index) index--;
+
+        // Delete the token
+        token.remove();
+        selected_token = null;
+
+        // Show the input box and give it focus again
+        input_box.focus();
+
+        // Remove this token from the saved list
+        saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
+        if(index < selected_token_index) selected_token_index--;
+
+        // Update the hidden input
+        update_hidden_input(saved_tokens, hidden_input);
+
+        token_count -= 1;
+
+        if(settings.tokenLimit !== null) {
+            input_box
+                .show()
+                .val("")
+                .focus();
+        }
+
+        // Execute the onDelete callback if defined
+        if($.isFunction(callback)) {
+            callback.call(hidden_input,token_data);
+        }
+    }
+
+    // Update the hidden input box value
+    function update_hidden_input(saved_tokens, hidden_input) {
+        var token_values = $.map(saved_tokens, function (el) {
+            return el[settings.tokenValue];
+        });
+        hidden_input.val(token_values.join(settings.tokenDelimiter));
+
+    }
+
+    // Hide and clear the results dropdown
+    function hide_dropdown () {
+        dropdown.hide().empty();
+        selected_dropdown_item = null;
+        if (settings.onHideDropdown)
+         settings.onHideDropdown();
+    }
+
+    function show_dropdown() {
+        dropdown
+            .css({
+                position: "absolute",
+                top: $(token_list).offset().top + $(token_list).outerHeight(),
+                left: $(token_list).offset().left,
+                zindex: 999
+            })
+            .show();
+        if (settings.onShowDropdown)
+         settings.onShowDropdown();
+    }
+
+    function show_dropdown_searching () {
+        if(settings.searchingText) {
+            dropdown.html("<p>"+settings.searchingText+"</p>");
+            show_dropdown();
+        }
+    }
+
+    function show_dropdown_hint () {
+        if(settings.hintText) {
+            dropdown.html("<p>"+settings.hintText+"</p>");
+            show_dropdown();
+        }
+    }
+
+    // Highlight the query part of the search term
+    function highlight_term(value, term) {
+        return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
+    }
+    
+    function find_value_and_highlight_term(template, value, term) {
+        return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + value + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term));
+    }
+
+    // Populate the results dropdown with some results
+    function populate_dropdown (query, results) {
+        if(results && results.length) {
+            dropdown.empty();
+            var dropdown_ul = $("<ul>")
+                .appendTo(dropdown)
+                .mouseover(function (event) {
+                    select_dropdown_item($(event.target).closest("li"));
+                })
+                .mousedown(function (event) {
+                    add_token($(event.target).closest("li").data("tokeninput"));
+                    hidden_input.change();
+                    return false;
+                })
+                .hide();
+            if (settings.noHoverSelect) {
+                dropdown_ul.off('mouseover');
+                dropdown_ul.on('mouseover',function (event) {
+                    $(this).find("li").removeClass(settings.classes.selectedDropdownItem);
+                    $(event.target).closest("li").addClass(settings.classes.selectedDropdownItem);
+                });
+            }
+
+            $.each(results, function(index, value) {
+                var this_li = settings.resultsFormatter(value);
+                
+                // this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);            
+                
+                this_li = $(this_li).appendTo(dropdown_ul);
+                
+                if(index % 2) {
+                    this_li.addClass(settings.classes.dropdownItem);
+                } else {
+                    this_li.addClass(settings.classes.dropdownItem2);
+                }
+
+                // if(index === 0) {
+                //     select_dropdown_item(this_li);
+                // }
+
+                $.data(this_li.get(0), "tokeninput", value);
+            });
+
+            show_dropdown();
+
+            if(settings.animateDropdown) {
+                dropdown_ul.slideDown("fast");
+            } else {
+                dropdown_ul.show();
+            }
+        } else {
+            if(settings.noResultsText) {
+                dropdown.html("<p>"+settings.noResultsText+"</p>");
+                show_dropdown();
+            }
+            if (settings.noResultsHideDropdown) {
+                hide_dropdown();
+            }
+        }
+    }
+
+    // Highlight an item in the results dropdown
+    function select_dropdown_item (item,withkeyboard) {
+        if(item) {
+            if(selected_dropdown_item) {
+                deselect_dropdown_item($(selected_dropdown_item));
+            }
+            if (settings.scrollKeyboard && withkeyboard) {
+                var list = $('.token-input-dropdown-tag ul');
+                var listheight = list.height();
+                var itemheight = item.outerHeight();
+                var itemtop = item.position().top;
+                if (itemtop > listheight) {
+                    var listscroll = list.scrollTop();
+                    list.scrollTop(listscroll + itemheight);
+                }
+                else if (itemtop < 0) {
+                    var listscroll = list.scrollTop();
+                    list.scrollTop(listscroll - itemheight);
+                }
+
+            }
+            item.addClass(settings.classes.selectedDropdownItem);
+            selected_dropdown_item = item.get(0);
+        }
+    }
+
+    // Remove highlighting from an item in the results dropdown
+    function deselect_dropdown_item (item) {
+        item.removeClass(settings.classes.selectedDropdownItem);
+        selected_dropdown_item = null;
+    }
+
+    // Do a search and show the "searching" dropdown if the input is longer
+    // than settings.minChars
+    function do_search() {
+        var query = input_box.val().toLowerCase();
+        if(query && query.length || settings.minChars == 0) {
+            if(selected_token) {
+                deselect_token($(selected_token), POSITION.AFTER);
+            }
+
+            if(query.length >= settings.minChars) {
+                show_dropdown_searching();
+                clearTimeout(timeout);
+
+                timeout = setTimeout(function(){
+                    run_search(query);
+                }, settings.searchDelay);
+            } else {
+                hide_dropdown();
+            }
+        }
+    }
+
+    // Do the actual search
+    function run_search(query) {
+        var cache_key = query + computeURL();
+        var cached_results = cache.get(cache_key);
+        if(cached_results) {
+            populate_dropdown(query, cached_results);
+        } else {
+            // Are we doing an ajax search or local data search?
+            if(settings.url) {
+                var url = computeURL();
+                // Extract exisiting get params
+                var ajax_params = {};
+                ajax_params.data = {};
+                if(url.indexOf("?") > -1) {
+                    var parts = url.split("?");
+                    ajax_params.url = parts[0];
+
+                    var param_array = parts[1].split("&");
+                    $.each(param_array, function (index, value) {
+                        var kv = value.split("=");
+                        ajax_params.data[kv[0]] = kv[1];
+                    });
+                } else {
+                    ajax_params.url = url;
+                }
+
+                // Prepare the request
+                ajax_params.data[settings.queryParam] = query;
+                ajax_params.type = settings.method;
+                ajax_params.dataType = settings.contentType;
+                if(settings.crossDomain) {
+                    ajax_params.dataType = "jsonp";
+                }
+
+                // Attach the success callback
+                ajax_params.success = function(results) {
+                  if($.isFunction(settings.onResult)) {
+                      results = settings.onResult.call(hidden_input, results);
+                  }
+                  cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);
+
+                  // only populate the dropdown if the results are associated with the active search query
+                  if(input_box.val().toLowerCase() === query) {
+                      populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
+                  }
+                };
+
+                // Make the request
+                $.ajax(ajax_params);
+            } else if(settings.search_function){
+                settings.search_function(query, function(results){
+                    cache.add(cache_key, results);
+                    populate_dropdown(query, results);
+                });
+            } else if(settings.local_data) {
+                // Do the search through local data
+                var results = $.grep(settings.local_data, function (row) {
+                    return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
+                });
+
+                if($.isFunction(settings.onResult)) {
+                    results = settings.onResult.call(hidden_input, results);
+                }
+                cache.add(cache_key, results);
+                populate_dropdown(query, results);
+            }
+        }
+    }
+
+    // compute the dynamic URL
+    function computeURL() {
+        var url = settings.url;
+        if(typeof settings.url == 'function') {
+            url = settings.url.call();
+        }
+        return url;
+    }
+};
+
+// Really basic cache for the results
+$.TokenList.Cache = function (options) {
+    var settings = $.extend({
+        max_size: 500
+    }, options);
+
+    var data = {};
+    var size = 0;
+
+    var flush = function () {
+        data = {};
+        size = 0;
+    };
+
+    this.add = function (query, results) {
+        if(size > settings.max_size) {
+            flush();
+        }
+
+        if(!data[query]) {
+            size += 1;
+        }
+
+        data[query] = results;
+    };
+
+    this.get = function (query) {
+        return data[query];
+    };
+};
+}(jQuery));
--- a/browser/extensions/pocket/content/pktApi.jsm
+++ b/browser/extensions/pocket/content/pktApi.jsm
@@ -41,17 +41,17 @@
  *      tags:             All tags for logged in user
  *      usedTags:         All used tags from within the extension sorted by recency
  */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, manager: Cm} = Components;
 this.EXPORTED_SYMBOLS = ["pktApi"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 
 var pktApi = (function() {
 
     /**
      * Configuration
      */
 
--- a/browser/extensions/pocket/content/pocket-content-process.js
+++ b/browser/extensions/pocket/content/pocket-content-process.js
@@ -3,18 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 // This file is loaded as a process script, it will be loaded in the parent
 // process as well as all content processes.
 
 const { utils: Cu } = Components;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("chrome://pocket/content/AboutPocket.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AboutPocket } = Cu.import("chrome://pocket/content/AboutPocket.jsm", {});
 
 function AboutPocketChildListener() {
 }
 AboutPocketChildListener.prototype = {
   onStartup: function onStartup() {
 
     // Only do this in content processes since, as the broadcaster of this
     // message, the parent process doesn't also receive it.  We handlers
--- a/browser/modules/AboutNewTab.jsm
+++ b/browser/modules/AboutNewTab.jsm
@@ -5,17 +5,17 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "AboutNewTab" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "RemotePages",
   "resource://gre/modules/RemotePageManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
   "resource://gre/modules/NewTabUtils.jsm");
 
 var AboutNewTab = {
--- a/browser/modules/AttributionCode.jsm
+++ b/browser/modules/AttributionCode.jsm
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["AttributionCode"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, 'AppConstants',
   'resource://gre/modules/AppConstants.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'OS',
   'resource://gre/modules/osfile.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Services',
   'resource://gre/modules/Services.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Task',
   'resource://gre/modules/Task.jsm');
--- a/browser/modules/BrowserUITelemetry.jsm
+++ b/browser/modules/BrowserUITelemetry.jsm
@@ -3,18 +3,18 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["BrowserUITelemetry"];
 
 const {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
   "resource://gre/modules/UITelemetry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
   "resource:///modules/RecentWindow.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "UITour",
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -4,18 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["BrowserUsageTelemetry"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
                                   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 // The upper bound for the count of the visited unique domain names.
 const MAX_UNIQUE_VISITED_DOMAINS = 100;
 
 // Observed topic names.
--- a/browser/modules/CaptivePortalWatcher.jsm
+++ b/browser/modules/CaptivePortalWatcher.jsm
@@ -9,20 +9,20 @@ const { classes: Cc, interfaces: Ci, uti
  * This constant is chosen to be large enough for a portal recheck to complete,
  * and small enough that the delay in opening a tab isn't too noticeable.
  * Please see comments for _delayedAddCaptivePortalTab for more details.
  */
 const PORTAL_RECHECK_DELAY_MS = 150;
 
 this.EXPORTED_SYMBOLS = [ "CaptivePortalWatcher" ];
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/RecentWindow.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { RecentWindow } = Cu.import("resource:///modules/RecentWindow.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "cps",
                                    "@mozilla.org/network/captive-portal-service;1",
                                    "nsICaptivePortalService");
 
 this.CaptivePortalWatcher = {
   // This holds a weak reference to the captive portal tab so that we
   // don't leak it if the user closes it.
--- a/browser/modules/CastingApps.jsm
+++ b/browser/modules/CastingApps.jsm
@@ -2,18 +2,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 this.EXPORTED_SYMBOLS = ["CastingApps"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { SimpleServiceDiscovery } = Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm", {});
 
 
 var CastingApps = {
   _sendEventToVideo: function (element, data) {
     let event = element.ownerDocument.createEvent("CustomEvent");
     event.initCustomEvent("media-videoCasting", false, true, JSON.stringify(data));
     element.dispatchEvent(event);
   },
--- a/browser/modules/ContentClick.jsm
+++ b/browser/modules/ContentClick.jsm
@@ -6,19 +6,19 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "ContentClick" ];
 
-Cu.import("resource:///modules/PlacesUIUtils.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { PlacesUIUtils } = Cu.import("resource:///modules/PlacesUIUtils.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 var ContentClick = {
   init: function() {
     let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
     mm.addMessageListener("Content:Click", this);
   },
 
   receiveMessage: function (message) {
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -8,18 +8,18 @@ var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 this.EXPORTED_SYMBOLS = [ "TabCrashHandler",
                           "PluginCrashReporter",
                           "UnsubmittedCrashHandler" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
   "resource://gre/modules/CrashSubmit.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RemotePages",
   "resource://gre/modules/RemotePageManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
--- a/browser/modules/ContentLinkHandler.jsm
+++ b/browser/modules/ContentLinkHandler.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "ContentLinkHandler" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/NetUtil.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Feeds",
   "resource:///modules/Feeds.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 
 const SIZES_TELEMETRY_ENUM = {
--- a/browser/modules/ContentObservers.jsm
+++ b/browser/modules/ContentObservers.jsm
@@ -12,17 +12,17 @@
  */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 var gEMEUIObserver = function(subject, topic, data) {
   let win = subject.top;
   let mm = getMessageManagerForWindow(win);
   if (mm) {
     mm.sendAsyncMessage("EMEVideo:ContentMediaKeysRequest", data);
   }
 };
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -5,20 +5,20 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "ContentSearch",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
   "resource://gre/modules/FormHistory.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SearchSuggestionController",
   "resource://gre/modules/SearchSuggestionController.jsm");
 
--- a/browser/modules/ContentWebRTC.jsm
+++ b/browser/modules/ContentWebRTC.jsm
@@ -3,18 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = [ "ContentWebRTC" ];
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyServiceGetter(this, "MediaManagerService",
                                    "@mozilla.org/mediaManagerService;1",
                                    "nsIMediaManagerService");
 
 this.ContentWebRTC = {
   _initialized: false,
 
   init: function() {
--- a/browser/modules/DirectoryLinksProvider.jsm
+++ b/browser/modules/DirectoryLinksProvider.jsm
@@ -8,20 +8,20 @@ this.EXPORTED_SYMBOLS = ["DirectoryLinks
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const ParserUtils =  Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils);
 
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
   "resource://gre/modules/NewTabUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
   "resource://gre/modules/osfile.jsm")
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
--- a/browser/modules/E10SUtils.jsm
+++ b/browser/modules/E10SUtils.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["E10SUtils"];
 
 const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function getAboutModule(aURL) {
   // Needs to match NS_GetAboutModuleName
   let moduleName = aURL.path.replace(/[#?].*/, "").toLowerCase();
   let contract = "@mozilla.org/network/protocol/about;1?what=" + moduleName;
   try {
     return Cc[contract].getService(Ci.nsIAboutModule);
   }
--- a/browser/modules/FormSubmitObserver.jsm
+++ b/browser/modules/FormSubmitObserver.jsm
@@ -15,19 +15,19 @@ var Cu = Components.utils;
 
 var HTMLInputElement = Ci.nsIDOMHTMLInputElement;
 var HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
 var HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
 var HTMLButtonElement = Ci.nsIDOMHTMLButtonElement;
 
 this.EXPORTED_SYMBOLS = [ "FormSubmitObserver" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { BrowserUtils } = Cu.import("resource://gre/modules/BrowserUtils.jsm", {});
 
 function FormSubmitObserver(aWindow, aTabChildGlobal) {
   this.init(aWindow, aTabChildGlobal);
 }
 
 FormSubmitObserver.prototype =
 {
   _validationMessage: "",
--- a/browser/modules/HiddenFrame.jsm
+++ b/browser/modules/HiddenFrame.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["HiddenFrame"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 const XUL_PAGE = "data:application/vnd.mozilla.xul+xml;charset=utf-8,<window%20id='win'/>";
 
 /**
  * An hidden frame object. It takes care of creating an IFRAME and attaching it the
  * |hiddenDOMWindow|.
  */
--- a/browser/modules/LaterRun.jsm
+++ b/browser/modules/LaterRun.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 this.EXPORTED_SYMBOLS = ["LaterRun"];
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "setInterval", "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "clearInterval", "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", "resource://gre/modules/RecentWindow.jsm");
 
 const kEnabledPref = "browser.laterrun.enabled";
 const kPagePrefRoot = "browser.laterrun.pages.";
 // Number of sessions we've been active in
 const kSessionCountPref = "browser.laterrun.bookkeeping.sessionCount";
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -56,17 +56,17 @@ this.EXPORTED_SYMBOLS = [
  * It is, however, possible to take advantage of PermissionPrompt without
  * having to go through nsIContentPermissionPrompt or with a
  * nsIContentPermissionRequest. The PermissionPromptPrototype can be
  * imported, subclassed, and have prompt() called directly, without
  * the caller having called into createPermissionPrompt.
  */
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
   return Services.strings
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -5,20 +5,20 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "PluginContent" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { BrowserUtils } = Cu.import("resource://gre/modules/BrowserUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "gNavigatorBundle", function() {
   const url = "chrome://browser/locale/browser.properties";
   return Services.strings.createBundle(url);
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
--- a/browser/modules/ProcessHangMonitor.jsm
+++ b/browser/modules/ProcessHangMonitor.jsm
@@ -6,18 +6,18 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = ["ProcessHangMonitor"];
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 /**
  * This JSM is responsible for observing content process hang reports
  * and asking the user what to do about them. See nsIHangReport for
  * the platform interface.
  */
 
 var ProcessHangMonitor = {
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -4,19 +4,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 this.EXPORTED_SYMBOLS = [ "ReaderParent" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.jsm");
 
 const gStringBundle = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
 
 var ReaderParent = {
--- a/browser/modules/RecentWindow.jsm
+++ b/browser/modules/RecentWindow.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["RecentWindow"];
 
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
 
 this.RecentWindow = {
   /*
    * Get the most recent browser window.
    *
    * @param aOptions an object accepting the arguments for the search.
    *        * private: true to restrict the search to private windows
    *            only, false to restrict the search to non-private only.
--- a/browser/modules/RemotePrompt.jsm
+++ b/browser/modules/RemotePrompt.jsm
@@ -8,18 +8,18 @@
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "RemotePrompt" ];
 
 Cu.import("resource:///modules/PlacesUIUtils.jsm");
 Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/SharedPromptUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PromptUtils } = Cu.import("resource://gre/modules/SharedPromptUtils.jsm", {});
 
 var RemotePrompt = {
   init: function() {
     let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
     mm.addMessageListener("Prompt:Open", this);
   },
 
   receiveMessage: function(message) {
--- a/browser/modules/SelfSupportBackend.jsm
+++ b/browser/modules/SelfSupportBackend.jsm
@@ -5,21 +5,21 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["SelfSupportBackend"];
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "HiddenFrame",
   "resource:///modules/HiddenFrame.jsm");
 
 // Enables or disables the Self Support.
 const PREF_ENABLED = "browser.selfsupport.enabled";
 // Url to open in the Self Support browser, in the urlFormatter service format.
 const PREF_URL = "browser.selfsupport.url";
--- a/browser/modules/Social.jsm
+++ b/browser/modules/Social.jsm
@@ -11,18 +11,18 @@ const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
 // The minimum sizes for the auto-resize panel code, minimum size necessary to
 // properly show the error page in the panel.
 const PANEL_MIN_HEIGHT = 190;
 const PANEL_MIN_WIDTH = 330;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SocialService",
   "resource:///modules/SocialService.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PageMetadata",
   "resource://gre/modules/PageMetadata.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
--- a/browser/modules/SocialService.jsm
+++ b/browser/modules/SocialService.jsm
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["SocialService"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 const URI_EXTENSION_STRINGS  = "chrome://mozapps/locale/extensions/extensions.properties";
 const ADDON_TYPE_SERVICE     = "service";
 const ID_SUFFIX              = "@services.mozilla.org";
 const STRING_TYPE_NAME       = "type.%ID%.name";
 
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", "resource://gre/modules/DeferredTask.jsm");
 
--- a/browser/modules/TabGroupsMigrator.jsm
+++ b/browser/modules/TabGroupsMigrator.jsm
@@ -3,17 +3,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["TabGroupsMigrator"];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown", "resource://gre/modules/AsyncShutdown.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
--- a/browser/modules/WindowsPreviewPerTab.jsm
+++ b/browser/modules/WindowsPreviewPerTab.jsm
@@ -42,21 +42,21 @@
  * when this threshold has been crossed.
  */
 this.EXPORTED_SYMBOLS = ["AeroPeek"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 // Pref to enable/disable preview-per-tab
 const TOGGLE_PREF_NAME = "browser.taskbar.previews.enable";
 // Pref to determine the magic auto-disable threshold
 const DISABLE_THRESHOLD_PREF_NAME = "browser.taskbar.previews.max";
 // Pref to control the time in seconds that tab contents live in the cache
 const CACHE_EXPIRATION_TIME_PREF_NAME = "browser.taskbar.previews.cachetime";
 
--- a/browser/modules/test/browser_NetworkPrioritizer.js
+++ b/browser/modules/test/browser_NetworkPrioritizer.js
@@ -42,17 +42,17 @@ function* setPriority(aBrowser, aPriorit
 
 function* isWindowState(aWindow, aTabPriorities) {
   let browsers = aWindow.gBrowser.browsers;
   // Make sure we have the right number of tabs & priorities
   is(browsers.length, aTabPriorities.length,
      "Window has expected number of tabs");
   // aState should be in format [ priority, priority, priority ]
   for (let i = 0; i < browsers.length; i++) {
-    is(yield getPriority(browsers[i]), aTabPriorities[i],
+    is((yield getPriority(browsers[i])), aTabPriorities[i],
        "Tab " + i + " had expected priority");
   }
 }
 
 function promiseWaitForFocus(aWindow) {
   return new Promise((resolve) => {
     waitForFocus(resolve, aWindow);
   });
@@ -119,23 +119,23 @@ add_task(function*() {
 
   // Set the priority of tab1 to the lowest possible. Selecting the other tab
   // will try to lower it
   yield setPriority(tab1, LOWEST);
 
   let tab2 = gBrowser.addTab("http://example.com");
   yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
   gBrowser.selectedTab = tab2;
-  is(yield getPriority(tab1), LOWEST - DELTA, "Can adjust priority beyond 'lowest'");
+  is((yield getPriority(tab1)), LOWEST - DELTA, "Can adjust priority beyond 'lowest'");
 
   // Now set priority to "highest" and make sure that no errors occur.
   yield setPriority(tab1, HIGHEST);
   gBrowser.selectedTab = tab1;
 
-  is(yield getPriority(tab1), HIGHEST + DELTA, "Can adjust priority beyond 'highest'");
+  is((yield getPriority(tab1)), HIGHEST + DELTA, "Can adjust priority beyond 'highest'");
 
   // Cleanup
   gBrowser.removeTab(tab2);
   yield setPriority(tab1, oldPriority);
 });
 
 add_task(function*() {
   // This tests that the priority doesn't get lost when switching the browser's remoteness
@@ -144,22 +144,22 @@ add_task(function*() {
     return;
   }
 
   let browser = gBrowser.selectedBrowser;
 
   browser.loadURI("http://example.com");
   yield BrowserTestUtils.browserLoaded(browser);
   ok(browser.isRemoteBrowser, "web page should be loaded in remote browser");
-  is(yield getPriority(browser), HIGH, "priority of selected tab should be 'high'");
+  is((yield getPriority(browser)), HIGH, "priority of selected tab should be 'high'");
 
   browser.loadURI("about:rights");
   yield BrowserTestUtils.browserLoaded(browser);
   ok(!browser.isRemoteBrowser, "about:rights should switch browser to non-remote");
-  is(yield getPriority(browser), HIGH,
+  is((yield getPriority(browser)), HIGH,
      "priority of selected tab should be 'high' when going from remote to non-remote");
 
   browser.loadURI("http://example.com");
   yield BrowserTestUtils.browserLoaded(browser);
   ok(browser.isRemoteBrowser, "going from about:rights to web page should switch browser to remote");
-  is(yield getPriority(browser), HIGH,
+  is((yield getPriority(browser)), HIGH,
      "priority of selected tab should be 'high' when going from non-remote to remote");
 });
--- a/browser/modules/test/browser_ProcessHangNotifications.js
+++ b/browser/modules/test/browser_ProcessHangNotifications.js
@@ -1,10 +1,10 @@
 
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
 
 function getNotificationBox(aWindow) {
   return aWindow.document.getElementById("high-priority-global-notificationbox");
 }
 
 function promiseNotificationShown(aWindow, aName) {
   return new Promise((resolve) => {
     let notification = getNotificationBox(aWindow);
--- a/browser/modules/test/head.js
+++ b/browser/modules/test/head.js
@@ -1,9 +1,9 @@
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 const SINGLE_TRY_TIMEOUT = 100;
 const NUMBER_OF_TRIES = 30;
 
 function waitForConditionPromise(condition, timeoutMsg, tryCount=NUMBER_OF_TRIES) {
   let defer = Promise.defer();
   let tries = 0;
   function checkCondition() {
--- a/browser/modules/test/unit/social/head.js
+++ b/browser/modules/test/unit/social/head.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var Social, SocialService;
 
 var manifests = [
   {
     name: "provider 1",
     origin: "https://example1.com",
--- a/browser/modules/test/unit/social/test_SocialService.js
+++ b/browser/modules/test/unit/social/test_SocialService.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
   "resource://testing-common/PlacesTestUtils.jsm");
 
 function run_test() {
   initApp();
 
   // NOTE: none of the manifests here can have a workerURL set, or we attempt
--- a/browser/modules/test/unit/social/test_SocialServiceMigration21.js
+++ b/browser/modules/test/unit/social/test_SocialServiceMigration21.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const DEFAULT_PREFS = Services.prefs.getDefaultBranch("social.manifest.");
 
 function run_test() {
   // Test must run at startup for migration to occur, so we can only test
   // one migration per test file
   initApp();
 
--- a/browser/modules/test/unit/social/test_SocialServiceMigration22.js
+++ b/browser/modules/test/unit/social/test_SocialServiceMigration22.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const DEFAULT_PREFS = Services.prefs.getDefaultBranch("social.manifest.");
 
 function run_test() {
   // Test must run at startup for migration to occur, so we can only test
   // one migration per test file
   initApp();
 
--- a/browser/modules/test/unit/social/test_SocialServiceMigration29.js
+++ b/browser/modules/test/unit/social/test_SocialServiceMigration29.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 
 function run_test() {
   // Test must run at startup for migration to occur, so we can only test
   // one migration per test file
   initApp();
 
   // NOTE: none of the manifests here can have a workerURL set, or we attempt
--- a/browser/modules/test/xpcshell/test_AttributionCode.js
+++ b/browser/modules/test/xpcshell/test_AttributionCode.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 "use strict";
 
 const {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource:///modules/AttributionCode.jsm");
-Cu.import('resource://gre/modules/osfile.jsm');
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { AttributionCode } = Cu.import("resource:///modules/AttributionCode.jsm", {});
+let { OS } = Cu.import('resource://gre/modules/osfile.jsm', {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let validAttrCodes = [
   {code: "source%3Dgoogle.com%26medium%3Dorganic%26campaign%3D(not%20set)%26content%3D(not%20set)",
    parsed: {"source": "google.com", "medium": "organic",
             "campaign": "(not%20set)", "content": "(not%20set)"}},
   {code: "source%3Dgoogle.com%26medium%3Dorganic%26campaign%3D%26content%3D",
    parsed: {"source": "google.com", "medium": "organic"}},
   {code: "source%3Dgoogle.com%26medium%3Dorganic%26campaign%3D(not%20set)",
--- a/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
+++ b/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
@@ -3,25 +3,25 @@
  */
 "use strict";
 
 /**
  * This file tests the DirectoryLinksProvider singleton in the DirectoryLinksProvider.jsm module.
  */
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu, Constructor: CC } = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/DirectoryLinksProvider.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { DirectoryLinksProvider } = Cu.import("resource:///modules/DirectoryLinksProvider.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 Cu.import("resource://gre/modules/Http.jsm");
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
   "resource://gre/modules/NewTabUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
   "resource://testing-common/PlacesTestUtils.jsm");
 
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["webrtcUI"];
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 
 this.webrtcUI = {
   init: function () {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/Screenshot.jsm
@@ -3,21 +3,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Screenshot"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 // Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
 // See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
 const PREF_LOG_LEVEL = "extensions.mozscreenshots@mozilla.org.loglevel";
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
     maxLogLevel: "info",
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
@@ -6,27 +6,27 @@
 
 this.EXPORTED_SYMBOLS = ["TestRunner"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
 const APPLY_CONFIG_TIMEOUT_MS = 60 * 1000;
 const HOME_PAGE = "chrome://mozscreenshots/content/lib/mozscreenshots.html";
 
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserTestUtils",
                                   "resource://testing-common/BrowserTestUtils.jsm");
 
-Cu.import("chrome://mozscreenshots/content/Screenshot.jsm");
+let { Screenshot } = Cu.import("chrome://mozscreenshots/content/Screenshot.jsm", {});
 
 // Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
 // See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
 const PREF_LOG_LEVEL = "extensions.mozscreenshots@mozilla.org.loglevel";
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
   let consoleOptions = {
     maxLogLevel: "info",
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/bootstrap.js
@@ -8,18 +8,18 @@ Workaround a build system bug where this
 */
 
 /* exported install, uninstall, startup, shutdown */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Timer.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "TestRunner",
                                   "chrome://mozscreenshots/content/TestRunner.jsm");
 
 function install(data, reason) {
   if (!isAppSupported()) {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/AppMenu.jsm
@@ -3,18 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["AppMenu"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.AppMenu = {
 
   init(libDir) {},
 
   configurations: {
     appMenuClosed: {
       applyConfig: Task.async(function*() {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Buttons.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Buttons"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource:///modules/CustomizableUI.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { CustomizableUI } = Cu.import("resource:///modules/CustomizableUI.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.Buttons = {
 
   init(libDir) {
     createWidget();
   },
 
   configurations: {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
@@ -3,22 +3,22 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ControlCenter"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://testing-common/BrowserTestUtils.jsm");
-Cu.import("resource:///modules/SitePermissions.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { BrowserTestUtils } = Cu.import("resource://testing-common/BrowserTestUtils.jsm", {});
+let { SitePermissions } = Cu.import("resource:///modules/SitePermissions.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
 
 const RESOURCE_PATH = "extensions/mozscreenshots/browser/chrome/mozscreenshots/lib/controlCenter";
 const HTTP_PAGE = "http://example.com/";
 const HTTPS_PAGE = "https://example.com/";
 const PERMISSIONS_PAGE = "https://test1.example.com/";
 const HTTP_PASSWORD_PAGE = `http://test2.example.org/${RESOURCE_PATH}/password.html`;
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/CustomizeMode.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/CustomizeMode.jsm
@@ -3,18 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["CustomizeMode"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 this.CustomizeMode = {
 
   init(libDir) {},
 
   configurations: {
     notCustomizing: {
       applyConfig() {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm
@@ -4,19 +4,19 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["DevEdition"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 const THEME_ID = "firefox-devedition@mozilla.org";
 
-Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { LightweightThemeManager } = Cu.import("resource://gre/modules/LightweightThemeManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.DevEdition = {
   init(libDir) {},
 
   configurations: {
     devEditionLight: {
       applyConfig: Task.async(() => {
         Services.prefs.setCharPref("devtools.theme", "light");
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevTools.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/DevTools.jsm
@@ -3,20 +3,20 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["DevTools"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://devtools/client/framework/gDevTools.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 let { devtools } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 let TargetFactory = devtools.TargetFactory;
 
 function getTargetForSelectedTab() {
   let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
   let target = TargetFactory.forTab(browserWindow.gBrowser.selectedTab);
   return target;
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/LightweightThemes.jsm
@@ -3,20 +3,20 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["LightweightThemes"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { LightweightThemeManager } = Cu.import("resource://gre/modules/LightweightThemeManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 this.LightweightThemes = {
   init(libDir) {
     // convert -size 3000x200 canvas:#333 black_theme.png
     let blackImage = libDir.clone();
     blackImage.append("black_theme.png");
     this._blackImageURL = Services.io.newFileURI(blackImage).spec;
 
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
@@ -3,21 +3,21 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PermissionPrompts"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource:///modules/E10SUtils.jsm");
-Cu.import("resource://testing-common/ContentTask.jsm");
-Cu.import("resource://testing-common/BrowserTestUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { E10SUtils } = Cu.import("resource:///modules/E10SUtils.jsm", {});
+let { ContentTask } = Cu.import("resource://testing-common/ContentTask.jsm", {});
+let { BrowserTestUtils } = Cu.import("resource://testing-common/BrowserTestUtils.jsm", {});
 
 const URL = "https://test1.example.com/extensions/mozscreenshots/browser/chrome/mozscreenshots/lib/permissionPrompts.html";
 let lastTab = null;
 
 this.PermissionPrompts = {
   init(libDir) {
     Services.prefs.setBoolPref("media.navigator.permission.fake", true);
     Services.prefs.setBoolPref("media.getusermedia.screensharing.allow_on_old_platforms", true);
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
@@ -3,20 +3,20 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Preferences"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://testing-common/TestUtils.jsm");
-Cu.import("resource://testing-common/ContentTask.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { TestUtils } = Cu.import("resource://testing-common/TestUtils.jsm", {});
+let { ContentTask } = Cu.import("resource://testing-common/ContentTask.jsm", {});
 
 this.Preferences = {
 
   init(libDir) {
     let panes = [
       ["paneGeneral", null],
       ["paneSearch", null],
       ["paneContent", null],
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm
@@ -8,19 +8,19 @@ this.EXPORTED_SYMBOLS = ["Tabs"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const CUST_TAB = "chrome://browser/skin/customizableui/customizeFavicon.ico";
 const PREFS_TAB = "chrome://browser/skin/preferences/in-content/favicon.ico";
 const DEFAULT_FAVICON_TAB = `data:text/html,<meta charset="utf-8">
 <title>No favicon</title>`;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 this.Tabs = {
   init(libDir) {},
 
   configurations: {
     fiveTabs: {
       applyConfig: Task.async(function*() {
         fiveTabsHelper();
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/TabsInTitlebar.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/TabsInTitlebar.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["TabsInTitlebar"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const PREF_TABS_IN_TITLEBAR = "browser.tabs.drawInTitlebar";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.TabsInTitlebar = {
 
   init(libDir) {},
 
   configurations: {
     tabsInTitlebar: {
       applyConfig: Task.async(function*() {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Toolbars.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Toolbars.jsm
@@ -3,18 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Toolbars"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.Toolbars = {
   init(libDir) {},
 
   configurations: {
     onlyNavBar: {
       applyConfig: Task.async(function*() {
         let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/WindowSize.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/WindowSize.jsm
@@ -3,20 +3,20 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["WindowSize"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://testing-common/BrowserTestUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { BrowserTestUtils } = Cu.import("resource://testing-common/BrowserTestUtils.jsm", {});
 
 this.WindowSize = {
 
   init(libDir) {
     Services.prefs.setBoolPref("browser.fullscreen.autohide", false);
   },
 
   configurations: {
--- a/toolkit/components/aboutmemory/content/aboutMemory.js
+++ b/toolkit/components/aboutmemory/content/aboutMemory.js
@@ -27,19 +27,19 @@ const KIND_NONHEAP           = Ci.nsIMem
 const KIND_HEAP              = Ci.nsIMemoryReporter.KIND_HEAP;
 const KIND_OTHER             = Ci.nsIMemoryReporter.KIND_OTHER;
 
 const UNITS_BYTES            = Ci.nsIMemoryReporter.UNITS_BYTES;
 const UNITS_COUNT            = Ci.nsIMemoryReporter.UNITS_COUNT;
 const UNITS_COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE;
 const UNITS_PERCENTAGE       = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
  "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
  "resource://gre/modules/FileUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "nsBinaryStream",
                             () => CC("@mozilla.org/binaryinputstream;1",
                                      "nsIBinaryInputStream",
--- a/toolkit/components/addoncompat/CompatWarning.jsm
+++ b/toolkit/components/addoncompat/CompatWarning.jsm
@@ -3,19 +3,19 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["CompatWarning"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "console",
                                   "resource://gre/modules/Console.jsm");
 
 function section(number, url)
 {
   const baseURL = "https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts";
   return { number, url: baseURL + url };
--- a/toolkit/components/addoncompat/Prefetcher.jsm
+++ b/toolkit/components/addoncompat/Prefetcher.jsm
@@ -2,18 +2,18 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["Prefetcher"];
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 
 // Rules are defined at the bottom of this file.
 var PrefetcherRules = {};
 
 /*
--- a/toolkit/components/addoncompat/RemoteAddonsChild.jsm
+++ b/toolkit/components/addoncompat/RemoteAddonsChild.jsm
@@ -4,18 +4,18 @@
 
 this.EXPORTED_SYMBOLS = ["RemoteAddonsChild"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Prefetcher",
                                   "resource://gre/modules/Prefetcher.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "SystemPrincipal",
                                    "@mozilla.org/systemprincipal;1", "nsIPrincipal");
--- a/toolkit/components/addoncompat/RemoteAddonsParent.jsm
+++ b/toolkit/components/addoncompat/RemoteAddonsParent.jsm
@@ -4,19 +4,19 @@
 
 this.EXPORTED_SYMBOLS = ["RemoteAddonsParent"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/RemoteWebProgress.jsm");
-Cu.import('resource://gre/modules/Services.jsm');
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { RemoteWebProgressManager } = Cu.import("resource://gre/modules/RemoteWebProgress.jsm", {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Prefetcher",
                                   "resource://gre/modules/Prefetcher.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CompatWarning",
--- a/toolkit/components/addoncompat/defaultShims.js
+++ b/toolkit/components/addoncompat/defaultShims.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 /**
  * Using multiprocessShims is optional, and if an add-on is e10s compatible it should not
  * use it. But in some cases we still want to use the interposition service for various
  * features so we have a default shim service.
  */
 
 function DefaultInterpositionService() {
--- a/toolkit/components/addoncompat/multiprocessShims.js
+++ b/toolkit/components/addoncompat/multiprocessShims.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Prefetcher",
                                   "resource://gre/modules/Prefetcher.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RemoteAddonsParent",
                                   "resource://gre/modules/RemoteAddonsParent.jsm");
 
 /**
  * This service overlays the API that the browser exposes to
--- a/toolkit/components/addoncompat/tests/addon/bootstrap.js
+++ b/toolkit/components/addoncompat/tests/addon/bootstrap.js
@@ -1,16 +1,16 @@
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { BrowserUtils } = Cu.import("resource://gre/modules/BrowserUtils.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const baseURL = "http://mochi.test:8888/browser/" +
   "toolkit/components/addoncompat/tests/browser/";
 
 var contentSecManager = Cc["@mozilla.org/contentsecuritymanager;1"]
                           .getService(Ci.nsIContentSecurityManager);
 
 function forEachWindow(f)
--- a/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
+++ b/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
@@ -1,14 +1,14 @@
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/BrowserUtils.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const baseURL = "http://mochi.test:8888/browser/" +
   "toolkit/components/addoncompat/tests/browser/";
 
 function forEachWindow(f)
 {
--- a/toolkit/components/alerts/resources/content/alert.js
+++ b/toolkit/components/alerts/resources/content/alert.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Copied from nsILookAndFeel.h, see comments on eMetric_AlertNotificationOrigin
 const NS_ALERT_HORIZONTAL = 1;
 const NS_ALERT_LEFT = 2;
 const NS_ALERT_TOP = 4;
 
 const WINDOW_MARGIN = AppConstants.platform == "win" ? 0 : 10;
 const BODY_TEXT_LIMIT = 200;
--- a/toolkit/components/asyncshutdown/tests/xpcshell/head.js
+++ b/toolkit/components/asyncshutdown/tests/xpcshell/head.js
@@ -2,20 +2,20 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 var Cu = Components.utils;
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { AsyncShutdown } = Cu.import("resource://gre/modules/AsyncShutdown.jsm", {});
 
 var asyncShutdownService = Cc["@mozilla.org/async-shutdown-service;1"].
   getService(Ci.nsIAsyncShutdownService);
 
 
 Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
 
 /**
--- a/toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js
+++ b/toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js
@@ -1,11 +1,11 @@
 "use strict";
 
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 function AutoCompleteInput(aSearches, aUserContextId) {
   this.searches = aSearches;
   this.userContextId = aUserContextId;
   this.popup.selectedIndex = -1;
 }
 AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
 
--- a/toolkit/components/captivedetect/captivedetect.js
+++ b/toolkit/components/captivedetect/captivedetect.js
@@ -2,18 +2,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "gSysMsgr",
                                    "@mozilla.org/system-message-internal;1",
                                    "nsISystemMessagesInternal");
 
 const DEBUG = false; // set to true to show debug messages
 
 const kCAPTIVEPORTALDETECTOR_CONTRACTID = '@mozilla.org/toolkit/captive-detector;1';
--- a/toolkit/components/captivedetect/test/unit/head_setprefs.js
+++ b/toolkit/components/captivedetect/test/unit/head_setprefs.js
@@ -1,19 +1,19 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 'use strict';
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
 Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://testing-common/httpd.js');
+let { HttpServer } = Cu.import('resource://testing-common/httpd.js', {});
 
 XPCOMUtils.defineLazyServiceGetter(this, 'gCaptivePortalDetector',
                                    '@mozilla.org/toolkit/captive-detector;1',
                                    'nsICaptivePortalDetector');
 
 const kCanonicalSitePath = '/canonicalSite.html';
 const kCanonicalSiteContent = 'true';
 const kPrefsCanonicalURL = 'captivedetect.canonicalURL';
--- a/toolkit/components/contentprefs/ContentPrefService2.jsm
+++ b/toolkit/components/contentprefs/ContentPrefService2.jsm
@@ -23,19 +23,19 @@
 // See https://bugzilla.mozilla.org/show_bug.cgi?id=699859
 
 var EXPORTED_SYMBOLS = [
   "ContentPrefService2",
 ];
 
 const { interfaces: Ci, classes: Cc, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ContentPrefUtils.jsm");
-Cu.import("resource://gre/modules/ContentPrefStore.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { ContentPref, cbHandleResult, cbHandleError, cbHandleCompletion } = Cu.import("resource://gre/modules/ContentPrefUtils.jsm", {});
+let { ContentPrefStore } = Cu.import("resource://gre/modules/ContentPrefStore.jsm", {});
 
 const GROUP_CLAUSE = `
   SELECT id
   FROM groups
   WHERE name = :group OR
         (:includeSubdomains AND name LIKE :pattern ESCAPE '/')
 `;
 
--- a/toolkit/components/contentprefs/ContentPrefServiceChild.jsm
+++ b/toolkit/components/contentprefs/ContentPrefServiceChild.jsm
@@ -6,18 +6,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "ContentPrefServiceChild" ];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ContentPrefUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { ContentPref, cbHandleResult, cbHandleError, cbHandleCompletion, safeCallback } = Cu.import("resource://gre/modules/ContentPrefUtils.jsm", {});
 Cu.import("resource://gre/modules/ContentPrefStore.jsm");
 
 // We only need one bit of information out of the context.
 function contextArg(context) {
   return (context && context.usePrivateBrowsing) ?
             { usePrivateBrowsing: true } :
             null;
 }
--- a/toolkit/components/contentprefs/ContentPrefUtils.jsm
+++ b/toolkit/components/contentprefs/ContentPrefUtils.jsm
@@ -10,17 +10,17 @@ this.EXPORTED_SYMBOLS = [
   "cbHandleResult",
   "cbHandleError",
   "cbHandleCompletion",
   "safeCallback",
 ];
 
 const { interfaces: Ci, classes: Cc, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 function ContentPref(domain, name, value) {
   this.domain = domain;
   this.name = name;
   this.value = value;
 }
 
--- a/toolkit/components/contentprefs/nsContentPrefService.js
+++ b/toolkit/components/contentprefs/nsContentPrefService.js
@@ -4,18 +4,18 @@
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 const CACHE_MAX_GROUP_ENTRIES = 100;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function ContentPrefService() {
   if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
     return Cu.import("resource://gre/modules/ContentPrefServiceChild.jsm")
              .ContentPrefServiceChild;
   }
 
   // If this throws an exception, it causes the getService call to fail,
@@ -25,17 +25,17 @@ function ContentPrefService() {
   this._dbInit();
 
   this._observerSvc.addObserver(this, "last-pb-context-exited", false);
 
   // Observe shutdown so we can shut down the database connection.
   this._observerSvc.addObserver(this, "xpcom-shutdown", false);
 }
 
-Cu.import("resource://gre/modules/ContentPrefStore.jsm");
+let { ContentPrefStore } = Cu.import("resource://gre/modules/ContentPrefStore.jsm", {});
 const cache = new ContentPrefStore();
 cache.set = function CPS_cache_set(group, name, val) {
   Object.getPrototypeOf(this).set.apply(this, arguments);
   let groupCount = this._groups.size;
   if (groupCount >= CACHE_MAX_GROUP_ENTRIES) {
     // Clean half of the entries
     for (let [group, name, ] of this) {
       this.remove(group, name);
--- a/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
+++ b/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
@@ -4,17 +4,17 @@
 
 // Inspired by the Places infrastructure in head_bookmarks.js
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import('resource://gre/modules/Services.jsm');
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 Cu.import('resource://gre/modules/ContentPrefInstance.jsm');
 
 const CONTENT_PREFS_DB_FILENAME = "content-prefs.sqlite";
 const CONTENT_PREFS_BACKUP_DB_FILENAME = "content-prefs.sqlite.corrupt";
 
 var ContentPrefTest = {
   //**************************************************************************//
   // Convenience Getters
--- a/toolkit/components/contextualidentity/ContextualIdentityService.jsm
+++ b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["ContextualIdentityService"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const DEFAULT_TAB_COLOR = "#909090";
 const SAVE_DELAY_MS = 1500;
 
 XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
   return Services.strings.createBundle("chrome://browser/locale/browser.properties");
 });
 
--- a/toolkit/components/contextualidentity/tests/unit/test_basic.js
+++ b/toolkit/components/contextualidentity/tests/unit/test_basic.js
@@ -1,15 +1,15 @@
 "use strict";
 
 do_get_profile();
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
+let { ContextualIdentityService } = Cu.import("resource://gre/modules/ContextualIdentityService.jsm", {});
 
 const TEST_STORE_FILE_NAME = "test-containers.json";
 
 let cis;
 
 // Basic tests
 add_task(function() {
   ok(!!ContextualIdentityService, "ContextualIdentityService exists");
--- a/toolkit/components/crashes/CrashManager.jsm
+++ b/toolkit/components/crashes/CrashManager.jsm
@@ -9,18 +9,18 @@ const myScope = this;
 
 Cu.import("resource://gre/modules/Log.jsm", this);
 Cu.import("resource://gre/modules/osfile.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/Timer.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm");
-Cu.import("resource://gre/modules/KeyValueParser.jsm");
+let { TelemetryController } = Cu.import("resource://gre/modules/TelemetryController.jsm", {});
+let { parseKeyValuePairsFromLines } = Cu.import("resource://gre/modules/KeyValueParser.jsm", {});
 
 this.EXPORTED_SYMBOLS = [
   "CrashManager",
 ];
 
 /**
  * How long to wait after application startup before crash event files are
  * automatically aggregated.
--- a/toolkit/components/crashmonitor/CrashMonitor.jsm
+++ b/toolkit/components/crashmonitor/CrashMonitor.jsm
@@ -31,20 +31,20 @@
  * does not necessarily tell us that the checkpoint wasn't reached.
  */
 
 this.EXPORTED_SYMBOLS = [ "CrashMonitor" ];
 
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 Cu.import("resource://gre/modules/AsyncShutdown.jsm");
 
 const NOTIFICATIONS = [
   "final-ui-startup",
   "sessionstore-windows-restored",
   "quit-application-granted",
   "quit-application",
   "profile-change-net-teardown",
--- a/toolkit/components/downloads/test/unit/head_download_manager.js
+++ b/toolkit/components/downloads/test/unit/head_download_manager.js
@@ -6,17 +6,17 @@
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 do_get_profile();
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://testing-common/httpd.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
 function createURI(aObj)
 {
   var ios = Cc["@mozilla.org/network/io-service;1"].
--- a/toolkit/components/downloads/test/unit/test_app_rep.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep.js
@@ -1,15 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import('resource://gre/modules/NetUtil.jsm');
+let { NetUtil } = Cu.import('resource://gre/modules/NetUtil.jsm', {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"].
                   getService(Ci.nsIApplicationReputationService);
 var gHttpServ = null;
 var gTables = {};
 
 var ALLOW_LIST = 0;
--- a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
@@ -1,22 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests signature extraction using Windows Authenticode APIs of
- * downloaded files.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-//// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
--- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
@@ -1,22 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests signature extraction using Windows Authenticode APIs of
- * downloaded files.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-//// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -18,18 +18,18 @@ this.EXPORTED_SYMBOLS = ["Extension", "E
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.importGlobalProperties(["TextEncoder"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionAPIs",
                                   "resource://gre/modules/ExtensionAPI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
@@ -57,33 +57,33 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "require",
                                   "resource://devtools/shared/Loader.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
                                   "resource://gre/modules/Schemas.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 Cu.import("resource://gre/modules/ExtensionContent.jsm");
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
+let { ExtensionManagement } = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "uuidGen",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 const BASE_SCHEMA = "chrome://extensions/content/schemas/manifest.json";
 const CATEGORY_EXTENSION_SCHEMAS = "webextension-schemas";
 const CATEGORY_EXTENSION_SCRIPTS = "webextension-scripts";
 
 let schemaURLs = new Set();
 
 if (!AppConstants.RELEASE_OR_BETA) {
   schemaURLs.add("chrome://extensions/content/schemas/experiments.json");
 }
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   BaseContext,
   EventEmitter,
   SchemaAPIManager,
   LocaleData,
   instanceOf,
   LocalAPIImplementation,
   flushJarCache,
@@ -106,17 +106,17 @@ const COMMENT_REGEXP = new RegExp(String
     )
 
     //.*
   `.replace(/\s+/g, ""), "gm");
 
 var GlobalManager;
 
 // This object loads the ext-*.js scripts that define the extension API.
-var Management = new class extends SchemaAPIManager {
+var Management = new (class extends SchemaAPIManager {
   constructor() {
     super("main");
     this.initialized = null;
   }
 
   // Loads all the ext-*.js scripts currently registered.
   lazyInit() {
     if (this.initialized) {
@@ -144,17 +144,17 @@ var Management = new class extends Schem
     return this.initialized;
   }
 
   registerSchemaAPI(namespace, envType, getAPI) {
     if (envType == "addon_parent" || envType == "content_parent") {
       super.registerSchemaAPI(namespace, envType, getAPI);
     }
   }
-}();
+})();
 
 // Subscribes to messages related to the extension messaging API and forwards it
 // to the relevant message manager. The "sender" field for the `onMessage` and
 // `onConnect` events are updated if needed.
 let ProxyMessenger = {
   _initialized: false,
   init() {
     if (this._initialized) {
--- a/toolkit/components/extensions/ExtensionAPI.jsm
+++ b/toolkit/components/extensions/ExtensionAPI.jsm
@@ -5,19 +5,19 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ExtensionAPI", "ExtensionAPIs"];
 
 /* exported ExtensionAPIs */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { ExtensionManagement } = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
                                   "resource://devtools/shared/event-emitter.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
                                   "resource://gre/modules/Schemas.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
--- a/toolkit/components/extensions/ExtensionChild.jsm
+++ b/toolkit/components/extensions/ExtensionChild.jsm
@@ -14,27 +14,27 @@ this.EXPORTED_SYMBOLS = ["ExtensionChild
  * Don't put contentscript logic here, use ExtensionContent.jsm instead.
  */
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
                                   "resource://gre/modules/MessageChannel.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
                                   "resource://gre/modules/Schemas.jsm");
 
 const CATEGORY_EXTENSION_SCRIPTS_ADDON = "webextension-scripts-addon";
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   getInnerWindowID,
   BaseContext,
   ChildAPIManager,
   LocalAPIImplementation,
   Messenger,
   SchemaAPIManager,
 } = ExtensionUtils;
@@ -42,17 +42,17 @@ var {
 // There is a circular dependency between Extension.jsm and us.
 // Long-term this file should not reference Extension.jsm (because they would
 // live in different processes), but for now use lazy getters.
 XPCOMUtils.defineLazyGetter(this, "findPathInObject",
   () => Cu.import("resource://gre/modules/Extension.jsm", {}).findPathInObject);
 XPCOMUtils.defineLazyGetter(this, "ParentAPIManager",
   () => Cu.import("resource://gre/modules/Extension.jsm", {}).ParentAPIManager);
 
-var apiManager = new class extends SchemaAPIManager {
+var apiManager = new (class extends SchemaAPIManager {
   constructor() {
     super("addon");
     this.initialized = false;
   }
 
   generateAPIs(...args) {
     if (!this.initialized) {
       this.initialized = true;
@@ -63,17 +63,17 @@ var apiManager = new class extends Schem
     return super.generateAPIs(...args);
   }
 
   registerSchemaAPI(namespace, envType, getAPI) {
     if (envType == "addon_child") {
       super.registerSchemaAPI(namespace, envType, getAPI);
     }
   }
-}();
+})();
 
 // A class that behaves identical to a ChildAPIManager, except
 // 1) creation of the ProxyContext in the parent is synchronous, and
 // 2) APIs without a local implementation and marked as incompatible with the
 //    out-of-process model fall back to directly invoking the parent methods.
 // TODO(robwu): Remove this when all APIs have migrated.
 class WannabeChildAPIManager extends ChildAPIManager {
   createProxyContextInConstructor(data) {
--- a/toolkit/components/extensions/ExtensionContent.jsm
+++ b/toolkit/components/extensions/ExtensionContent.jsm
@@ -18,18 +18,18 @@ this.EXPORTED_SYMBOLS = ["ExtensionConte
  * processes.
  */
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
                                   "resource://gre/modules/ExtensionManagement.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
                                   "resource:///modules/translation/LanguageDetector.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
                                   "resource://gre/modules/MatchPattern.jsm");
@@ -39,19 +39,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/MessageChannel.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
                                   "resource://gre/modules/PromiseUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
                                   "resource://gre/modules/Schemas.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
                                   "resource://gre/modules/WebNavigationFrames.jsm");
 
-Cu.import("resource://gre/modules/ExtensionChild.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionChild } = Cu.import("resource://gre/modules/ExtensionChild.jsm", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   runSafeSyncWithoutClone,
   BaseContext,
   LocaleData,
   Messenger,
   flushJarCache,
   getInnerWindowID,
   promiseDocumentReady,
@@ -65,17 +64,17 @@ const CATEGORY_EXTENSION_SCRIPTS_CONTENT
 
 function isWhenBeforeOrSame(when1, when2) {
   let table = {"document_start": 0,
                "document_end": 1,
                "document_idle": 2};
   return table[when1] <= table[when2];
 }
 
-var apiManager = new class extends SchemaAPIManager {
+var apiManager = new (class extends SchemaAPIManager {
   constructor() {
     super("content");
     this.initialized = false;
   }
 
   generateAPIs(...args) {
     if (!this.initialized) {
       this.initialized = true;
@@ -86,17 +85,17 @@ var apiManager = new class extends Schem
     return super.generateAPIs(...args);
   }
 
   registerSchemaAPI(namespace, envType, getAPI) {
     if (envType == "content_child") {
       super.registerSchemaAPI(namespace, envType, getAPI);
     }
   }
-}();
+})();
 
 // Represents a content script.
 function Script(extension, options, deferred = PromiseUtils.defer()) {
   this.extension = extension;
   this.options = options;
   this.run_at = this.options.run_at;
   this.js = this.options.js || [];
   this.css = this.options.css || [];
--- a/toolkit/components/extensions/ExtensionManagement.jsm
+++ b/toolkit/components/extensions/ExtensionManagement.jsm
@@ -7,18 +7,18 @@
 this.EXPORTED_SYMBOLS = ["ExtensionManagement"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
                                   "resource://gre/modules/ExtensionUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "console", () => ExtensionUtils.getConsole());
 
 XPCOMUtils.defineLazyGetter(this, "UUIDMap", () => {
   let {UUIDMap} = Cu.import("resource://gre/modules/Extension.jsm", {});
--- a/toolkit/components/extensions/ExtensionStorage.jsm
+++ b/toolkit/components/extensions/ExtensionStorage.jsm
@@ -6,18 +6,18 @@
 
 this.EXPORTED_SYMBOLS = ["ExtensionStorage"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 
 function jsonReplacer(key, value) {
   switch (typeof(value)) {
     // Serialize primitive types as-is.
--- a/toolkit/components/extensions/ExtensionUtils.jsm
+++ b/toolkit/components/extensions/ExtensionUtils.jsm
@@ -8,18 +8,18 @@ this.EXPORTED_SYMBOLS = ["ExtensionUtils
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const INTEGER = /^[1-9]\d*$/;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ConsoleAPI",
                                   "resource://gre/modules/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
--- a/toolkit/components/extensions/LegacyExtensionsUtils.jsm
+++ b/toolkit/components/extensions/LegacyExtensionsUtils.jsm
@@ -10,24 +10,24 @@ this.EXPORTED_SYMBOLS = ["LegacyExtensio
 
 /**
  * This file exports helpers for Legacy Extensions that want to embed a webextensions
  * and exchange messages with the embedded WebExtension.
  */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Extension",
                                   "resource://gre/modules/Extension.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 var {
   BaseContext,
   Messenger,
 } = ExtensionUtils;
 
 /**
  * Instances created from this class provide to a legacy extension
--- a/toolkit/components/extensions/MessageChannel.jsm
+++ b/toolkit/components/extensions/MessageChannel.jsm
@@ -100,18 +100,18 @@ this.EXPORTED_SYMBOLS = ["MessageChannel
 
 /* globals MessageChannel */
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
                                   "resource://gre/modules/PromiseUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 
 /**
--- a/toolkit/components/extensions/NativeMessaging.jsm
+++ b/toolkit/components/extensions/NativeMessaging.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["HostManifestManager", "NativeApp"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
--- a/toolkit/components/extensions/Schemas.jsm
+++ b/toolkit/components/extensions/Schemas.jsm
@@ -8,21 +8,20 @@ const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const global = this;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   instanceOf,
 } = ExtensionUtils;
 
 XPCOMUtils.defineLazyServiceGetter(this, "contentPolicyService",
                                    "@mozilla.org/addons/content-policy;1",
                                    "nsIAddonContentPolicy");
 
--- a/toolkit/components/extensions/ext-alarms.js
+++ b/toolkit/components/extensions/ext-alarms.js
@@ -1,13 +1,13 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   EventManager,
 } = ExtensionUtils;
 
 // WeakMap[Extension -> Map[name -> Alarm]]
 var alarmsMap = new WeakMap();
 
 // WeakMap[Extension -> Set[callback]]
--- a/toolkit/components/extensions/ext-backgroundPage.js
+++ b/toolkit/components/extensions/ext-backgroundPage.js
@@ -1,19 +1,19 @@
 "use strict";
 
 var {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 const {
   promiseDocumentLoaded,
   promiseObserved,
 } = ExtensionUtils;
 
 const XUL_URL = "data:application/vnd.mozilla.xul+xml;charset=utf-8," + encodeURI(
   `<?xml version="1.0"?>
   <window id="documentElement"/>`);
--- a/toolkit/components/extensions/ext-browser-content.js
+++ b/toolkit/components/extensions/ext-browser-content.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
                                   "resource://gre/modules/Timer.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "require",
                                   "resource://devtools/shared/Loader.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
--- a/toolkit/components/extensions/ext-cookies.js
+++ b/toolkit/components/extensions/ext-cookies.js
@@ -1,14 +1,14 @@
 "use strict";
 
 const {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 var {
   EventManager,
 } = ExtensionUtils;
 
 var DEFAULT_STORE = "firefox-default";
 var PRIVATE_STORE = "firefox-private";
 
--- a/toolkit/components/extensions/ext-downloads.js
+++ b/toolkit/components/extensions/ext-downloads.js
@@ -1,28 +1,28 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
                                   "resource://devtools/shared/event-emitter.js");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 const {
   ignoreEvent,
   normalizeTime,
   runSafeSync,
   SingletonEventManager,
   PlatformInfo,
 } = ExtensionUtils;
 
--- a/toolkit/components/extensions/ext-i18n.js
+++ b/toolkit/components/extensions/ext-i18n.js
@@ -1,13 +1,13 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   detectLanguage,
 } = ExtensionUtils;
 
 function i18nApiFactory(context) {
   let {extension} = context;
   return {
     i18n: {
--- a/toolkit/components/extensions/ext-idle.js
+++ b/toolkit/components/extensions/ext-idle.js
@@ -1,13 +1,13 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
                                   "resource://devtools/shared/event-emitter.js");
 XPCOMUtils.defineLazyServiceGetter(this, "idleService",
                                    "@mozilla.org/widget/idleservice;1",
                                    "nsIIdleService");
 const {
   SingletonEventManager,
--- a/toolkit/components/extensions/ext-notifications.js
+++ b/toolkit/components/extensions/ext-notifications.js
@@ -1,13 +1,13 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
                                   "resource://devtools/shared/event-emitter.js");
 
 var {
   EventManager,
   ignoreEvent,
 } = ExtensionUtils;
--- a/toolkit/components/extensions/ext-runtime.js
+++ b/toolkit/components/extensions/ext-runtime.js
@@ -1,15 +1,14 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
                                   "resource://gre/modules/ExtensionManagement.jsm");
 
 var {
   EventManager,
--- a/toolkit/components/extensions/ext-storage.js
+++ b/toolkit/components/extensions/ext-storage.js
@@ -1,16 +1,16 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
                                   "resource://gre/modules/ExtensionStorage.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   EventManager,
 } = ExtensionUtils;
 
 function storageApiFactory(context) {
   let {extension} = context;
   return {
     storage: {
--- a/toolkit/components/extensions/ext-webNavigation.js
+++ b/toolkit/components/extensions/ext-webNavigation.js
@@ -1,22 +1,22 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
                                   "resource://gre/modules/ExtensionManagement.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "MatchURLFilters",
                                   "resource://gre/modules/MatchPattern.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebNavigation",
                                   "resource://gre/modules/WebNavigation.jsm");
 
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   SingletonEventManager,
   ignoreEvent,
   runSafe,
 } = ExtensionUtils;
 
 const defaultTransitionTypes = {
   topFrame: "link",
--- a/toolkit/components/extensions/ext-webRequest.js
+++ b/toolkit/components/extensions/ext-webRequest.js
@@ -1,21 +1,21 @@
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
                                   "resource://gre/modules/MatchPattern.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebRequest",
                                   "resource://gre/modules/WebRequest.jsm");
 
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { ExtensionManagement } = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   SingletonEventManager,
   runSafeSync,
 } = ExtensionUtils;
 
 // EventManager-like class specifically for WebRequest. Inherits from
 // SingletonEventManager. Takes care of converting |details| parameter
 // when invoking listeners.
--- a/toolkit/components/extensions/test/xpcshell/test_csp_custom_policies.js
+++ b/toolkit/components/extensions/test/xpcshell/test_csp_custom_policies.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 const ADDON_ID = "test@web.extension";
 
 const aps = Cc["@mozilla.org/addons/policy-service;1"]
   .getService(Ci.nsIAddonPolicyService).wrappedJSObject;
 
 do_register_cleanup(() => {
   aps.setAddonCSP(ADDON_ID, null);
--- a/toolkit/components/extensions/test/xpcshell/test_ext_background_generated_load_events.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_background_generated_load_events.js
@@ -11,13 +11,13 @@ add_task(function* test_DOMContentLoaded
         browser.test.sendMessage("eventname", event.type);
       }
       document.addEventListener("DOMContentLoaded", reportListener);
       window.addEventListener("load", reportListener);
     },
   });
 
   yield extension.startup();
-  equal("DOMContentLoaded", yield extension.awaitMessage("eventname"));
-  equal("load", yield extension.awaitMessage("eventname"));
+  equal("DOMContentLoaded", (yield extension.awaitMessage("eventname")));
+  equal("load", (yield extension.awaitMessage("eventname")));
 
   yield extension.unload();
 });
--- a/toolkit/components/extensions/test/xpcshell/test_ext_background_global_history.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_background_global_history.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://testing-common/PlacesTestUtils.jsm");
+let { PlacesTestUtils } = Cu.import("resource://testing-common/PlacesTestUtils.jsm", {});
 
 add_task(function* test_global_history() {
   let extension = ExtensionTestUtils.loadExtension({
     background() {
       browser.test.sendMessage("background-loaded", location.href);
     },
   });
 
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
@@ -1,15 +1,14 @@
 "use strict";
 
 const global = this;
 
-Cu.import("resource://gre/modules/Timer.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { ExtensionUtils } = Cu.import("resource://gre/modules/ExtensionUtils.jsm", {});
 var {
   BaseContext,
   EventManager,
   SingletonEventManager,
 } = ExtensionUtils;
 
 class StubContext extends BaseContext {
   constructor() {
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
@@ -1,16 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-/* global OS */
-
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Downloads.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Downloads } = Cu.import("resource://gre/modules/Downloads.jsm", {});
 
 const server = createHttpServer();
 server.registerDirectory("/data/", do_get_file("data"));
 
 const WINDOWS = AppConstants.platform == "win";
 
 const BASE = `http://localhost:${server.identity.primaryPort}/data`;
 const FILE_NAME = "file_download.txt";
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/Downloads.jsm");
+let { Downloads } = Cu.import("resource://gre/modules/Downloads.jsm", {});
 
 const server = createHttpServer();
 server.registerDirectory("/data/", do_get_file("data"));
 
 const ROOT = `http://localhost:${server.identity.primaryPort}`;
 const BASE = `${ROOT}/data`;
 const TXT_FILE = "file_download.txt";
 const TXT_URL = BASE + "/" + TXT_FILE;
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/Downloads.jsm");
+let { Downloads } = Cu.import("resource://gre/modules/Downloads.jsm", {});
 
 const server = createHttpServer();
 server.registerDirectory("/data/", do_get_file("data"));
 
 const BASE = `http://localhost:${server.identity.primaryPort}/data`;
 const TXT_FILE = "file_download.txt";
 const TXT_URL = BASE + "/" + TXT_FILE;
 const TXT_LEN = 46;
--- a/toolkit/components/extensions/test/xpcshell/test_ext_idle.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_idle.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 let idleService = {
   _observers: new Set(),
   _activity: {
     addCalls: [],
     removeCalls: [],
     observerFires: [],
   },
--- a/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_context.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_context.js
@@ -1,13 +1,11 @@
 "use strict";
 
-/* globals browser */
-
-Cu.import("resource://gre/modules/Extension.jsm");
+let { Extension } = Cu.import("resource://gre/modules/Extension.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const {LegacyExtensionContext} = Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm");
 
 /**
  * This test case ensures that LegacyExtensionContext instances:
  *  - expose the expected API object and can join the messaging
  *    of a webextension given its addon id
--- a/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
@@ -1,13 +1,11 @@
 "use strict";
 
-/* globals browser */
-
-Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm");
+let { LegacyExtensionsUtils } = Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm", {});
 
 // Import EmbeddedExtensionManager to be able to check that the
 // tacked instances are cleared after the embedded extension shutdown.
 const {
   EmbeddedExtensionManager,
 } = Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm", {});
 
 /**
--- a/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
@@ -1,15 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://testing-common/AddonTestUtils.jsm");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { AddonTestUtils } = Cu.import("resource://testing-common/AddonTestUtils.jsm", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 const {promiseAddonByID} = AddonTestUtils;
 const id = "uninstall_self_test@tests.mozilla.com";
 
 const manifest = {
   applications: {
     gecko: {
       id,
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_async.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_async.js
@@ -186,26 +186,26 @@ add_task(function* testAsyncResults() {
         do_check_eq(cb, undefined);
         return Promise.resolve(2);
       },
     });
     if (!isChromeCompat) {  // No promises for chrome.
       do_print("testnamespace.async_required should be a Promise");
       let promise = testnamespace.async_required();
       do_check_true(promise instanceof context.cloneScope.Promise);
-      do_check_eq(yield promise, 1);
+      do_check_eq((yield promise), 1);
 
       do_print("testnamespace.async_optional should be a Promise");
       promise = testnamespace.async_optional();
       do_check_true(promise instanceof context.cloneScope.Promise);
-      do_check_eq(yield promise, 2);
+      do_check_eq((yield promise), 2);
     }
 
-    do_check_eq(yield* runWithCallback(testnamespace.async_required), 1);
-    do_check_eq(yield* runWithCallback(testnamespace.async_optional), 2);
+    do_check_eq((yield* runWithCallback(testnamespace.async_required)), 1);
+    do_check_eq((yield* runWithCallback(testnamespace.async_optional)), 2);
 
     let otherSandbox = Cu.Sandbox(null, {});
     let errorFactories = [
       msg => { throw new context.cloneScope.Error(msg); },
       msg => context.cloneScope.Promise.reject({message: msg}),
       msg => Cu.evalInSandbox(`throw new Error("${msg}")`, otherSandbox),
       msg => Cu.evalInSandbox(`Promise.reject({message: "${msg}"})`, otherSandbox),
     ];
@@ -220,13 +220,13 @@ add_task(function* testAsyncResults() {
 
       if (!isChromeCompat) {  // No promises for chrome.
         yield Assert.rejects(testnamespace.async_required(), /ONE/,
             "should reject testnamespace.async_required()").catch(() => {});
         yield Assert.rejects(testnamespace.async_optional(), /TWO/,
             "should reject testnamespace.async_optional()").catch(() => {});
       }
 
-      do_check_eq(yield* runFailCallback(testnamespace.async_required), "ONE");
-      do_check_eq(yield* runFailCallback(testnamespace.async_optional), "TWO");
+      do_check_eq((yield* runFailCallback(testnamespace.async_required)), "ONE");
+      do_check_eq((yield* runFailCallback(testnamespace.async_optional)), "TWO");
     }
   }
 });
--- a/toolkit/components/extensions/test/xpcshell/test_ext_topSites.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_topSites.js
@@ -1,11 +1,11 @@
 "use strict";
 
-Cu.import("resource://gre/modules/NewTabUtils.jsm");
+let { NewTabUtils } = Cu.import("resource://gre/modules/NewTabUtils.jsm", {});
 
 
 function TestProvider(getLinksFn) {
   this.getLinks = getLinksFn;
   this._observers = new Set();
 }
 
 TestProvider.prototype = {
--- a/toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
+++ b/toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
@@ -1,12 +1,12 @@
 "use strict";
 
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ExtensionManagement } = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function createWindowWithAddonId(addonId) {
   let baseURI = Services.io.newURI("about:blank", null, null);
   let originAttributes = {addonId};
   let principal = Services.scriptSecurityManager
                           .createCodebasePrincipal(baseURI, originAttributes);
   let chromeNav = Services.appShell.createWindowlessBrowser(true);
   let interfaceRequestor = chromeNav.QueryInterface(Ci.nsIInterfaceRequestor);
--- a/toolkit/components/extensions/test/xpcshell/test_locale_data.js
+++ b/toolkit/components/extensions/test/xpcshell/test_locale_data.js
@@ -1,11 +1,11 @@
 "use strict";
 
-Cu.import("resource://gre/modules/Extension.jsm");
+let { Extension, ExtensionData } = Cu.import("resource://gre/modules/Extension.jsm", {});
 
 /* globals ExtensionData */
 
 const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
 
 function* generateAddon(data) {
   let id = uuidGenerator.generateUUID().number;
 
--- a/toolkit/components/extensions/test/xpcshell/test_native_messaging.js
+++ b/toolkit/components/extensions/test/xpcshell/test_native_messaging.js
@@ -1,19 +1,18 @@
 "use strict";
 
-/* global OS, HostManifestManager, NativeApp */
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Schemas.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { AsyncShutdown } = Cu.import("resource://gre/modules/AsyncShutdown.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { Schemas } = Cu.import("resource://gre/modules/Schemas.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 const {Subprocess, SubprocessImpl} = Cu.import("resource://gre/modules/Subprocess.jsm");
-Cu.import("resource://gre/modules/NativeMessaging.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { HostManifestManager, NativeApp } = Cu.import("resource://gre/modules/NativeMessaging.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 let registry = null;
 if (AppConstants.platform == "win") {
   Cu.import("resource://testing-common/MockRegistry.jsm");
   registry = new MockRegistry();
   do_register_cleanup(() => {
     registry.shutdown();
   });
--- a/toolkit/components/feeds/test/head.js
+++ b/toolkit/components/feeds/test/head.js
@@ -1,17 +1,17 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 function readTestData(testFile) {
   var testcase = {};
 
   // Got a feed file, now we need to parse out the Description and Expect headers.
   var istream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
   try {
     istream.init(testFile, 0x01, parseInt("0444", 8), 0);
--- a/toolkit/components/formautofill/FormAutofill.jsm
+++ b/toolkit/components/formautofill/FormAutofill.jsm
@@ -9,18 +9,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "FormAutofill",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Integration.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Integration } = Cu.import("resource://gre/modules/Integration.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 /**
  * Main module handling references to objects living in the main process.
  */
 this.FormAutofill = {
   /**
    * Registers new overrides for the FormAutofillIntegration methods.  Example:
    *
--- a/toolkit/components/formautofill/FormAutofillContentService.js
+++ b/toolkit/components/formautofill/FormAutofillContentService.js
@@ -8,18 +8,18 @@
  *
  * See the nsIFormAutofillContentService documentation for details.
  */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FormAutofill",
                                   "resource://gre/modules/FormAutofill.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 /**
  * Handles requestAutocomplete for a DOM Form element.
--- a/toolkit/components/formautofill/FormAutofillIntegration.jsm
+++ b/toolkit/components/formautofill/FormAutofillIntegration.jsm
@@ -14,17 +14,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "FormAutofillIntegration",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RequestAutocompleteUI",
                                   "resource://gre/modules/RequestAutocompleteUI.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
--- a/toolkit/components/formautofill/FormAutofillStartup.js
+++ b/toolkit/components/formautofill/FormAutofillStartup.js
@@ -6,17 +6,17 @@
  * Handles startup in the parent process.
  */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FormAutofill",
                                   "resource://gre/modules/FormAutofill.jsm");
 
 /**
  * Handles startup in the parent process.
  */
 function FormAutofillStartup() {
--- a/toolkit/components/formautofill/content/RequestAutocompleteUI.jsm
+++ b/toolkit/components/formautofill/content/RequestAutocompleteUI.jsm
@@ -9,18 +9,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "RequestAutocompleteUI",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 /**
  * Handles the requestAutocomplete user interface.
--- a/toolkit/components/formautofill/content/requestAutocomplete.js
+++ b/toolkit/components/formautofill/content/requestAutocomplete.js
@@ -5,18 +5,18 @@
 /*
  * Implementation of "requestAutocomplete.xhtml".
  */
 
 "use strict";
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 const RequestAutocompleteDialog = {
   resolveFn: null,
--- a/toolkit/components/gfx/SanityTest.js
+++ b/toolkit/components/gfx/SanityTest.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { utils: Cu, interfaces: Ci, classes: Cc, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import('resource://gre/modules/Preferences.jsm');
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import('resource://gre/modules/Preferences.jsm', {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 const FRAME_SCRIPT_URL = "chrome://gfxsanity/content/gfxFrameScript.js";
 
 const PAGE_WIDTH=92;
 const PAGE_HEIGHT=166;
 const DRIVER_PREF="sanity-test.driver-version";
 const DEVICE_PREF="sanity-test.device-id";
--- a/toolkit/components/jsdownloads/src/DownloadCore.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadCore.jsm
@@ -53,18 +53,18 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/Integration.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Integration } = Cu.import("resource://gre/modules/Integration.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm")
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
--- a/toolkit/components/jsdownloads/src/DownloadImport.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadImport.jsm
@@ -13,17 +13,17 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm")
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
--- a/toolkit/components/jsdownloads/src/DownloadLegacy.js
+++ b/toolkit/components/jsdownloads/src/DownloadLegacy.js
@@ -19,17 +19,17 @@
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadLegacyTransfer
--- a/toolkit/components/jsdownloads/src/DownloadList.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadList.jsm
@@ -29,17 +29,17 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadList
--- a/toolkit/components/jsdownloads/src/DownloadStore.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadStore.jsm
@@ -37,17 +37,17 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm")
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
--- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
@@ -17,18 +17,18 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
--- a/toolkit/components/jsdownloads/src/Downloads.jsm
+++ b/toolkit/components/jsdownloads/src/Downloads.jsm
@@ -17,19 +17,19 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/Integration.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/DownloadCore.jsm");
+let { Integration } = Cu.import("resource://gre/modules/Integration.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Download, DownloadError } = Cu.import("resource://gre/modules/DownloadCore.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadCombinedList",
                                   "resource://gre/modules/DownloadList.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadList",
                                   "resource://gre/modules/DownloadList.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadSummary",
                                   "resource://gre/modules/DownloadList.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadUIHelper",
--- a/toolkit/components/jsdownloads/test/browser/head.js
+++ b/toolkit/components/jsdownloads/test/browser/head.js
@@ -12,17 +12,17 @@
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
--- a/toolkit/components/jsdownloads/test/unit/head.js
+++ b/toolkit/components/jsdownloads/test/unit/head.js
@@ -12,18 +12,18 @@
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/Integration.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Integration } = Cu.import("resource://gre/modules/Integration.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
--- a/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
+++ b/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/lz4.js");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { Lz4 } = Cu.import("resource://gre/modules/lz4.js", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 function run_test() {
   run_next_test();
 }
 
 function compare_arrays(a, b) {
   return Array.prototype.join.call(a) == Array.prototype.join.call(a);
 }
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
+++ b/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 const PATH = "/file.meh";
 var httpserver = new HttpServer();
 
 // Each time, the data consist in a string that should be sniffed as Ogg.
 const data = "OggS\0meeeh.";
 var testRan = 0;
 
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
+++ b/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
@@ -6,18 +6,18 @@ var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cc = Components.classes;
 var CC = Components.Constructor;
 
 var BinaryOutputStream = CC("@mozilla.org/binaryoutputstream;1",
                             "nsIBinaryOutputStream",
                             "setOutputStream");
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 var httpserver = new HttpServer();
 
 var testRan = 0;
 
 // The tests files we want to test, and the type we should have after sniffing.
 const tests = [
   // Real webm and mkv files truncated to 512 bytes.
--- a/toolkit/components/microformats/test/static/javascript/chai.js
+++ b/toolkit/components/microformats/test/static/javascript/chai.js
@@ -1,9 +1,9 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw (f.code="MODULE_NOT_FOUND", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
 /*!
  * chai
  * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
  * MIT Licensed
  */
 
 var used = [];
 exports = module.exports = {};
--- a/toolkit/components/narrate/NarrateControls.jsm
+++ b/toolkit/components/narrate/NarrateControls.jsm
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/narrate/VoiceSelect.jsm");
-Cu.import("resource://gre/modules/narrate/Narrator.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AsyncPrefs.jsm");
+let { VoiceSelect } = Cu.import("resource://gre/modules/narrate/VoiceSelect.jsm", {});
+let { Narrator } = Cu.import("resource://gre/modules/narrate/Narrator.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AsyncPrefs } = Cu.import("resource://gre/modules/AsyncPrefs.jsm", {});
 
 this.EXPORTED_SYMBOLS = ["NarrateControls"];
 
 var gStrings = Services.strings.createBundle("chrome://global/locale/narrate.properties");
 
 function NarrateControls(mm, win) {
   this._mm = mm;
   this._winRef = Cu.getWeakReference(win);
--- a/toolkit/components/narrate/Narrator.jsm
+++ b/toolkit/components/narrate/Narrator.jsm
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
   "resource:///modules/translation/LanguageDetector.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 
 this.EXPORTED_SYMBOLS = [ "Narrator" ];
 
--- a/toolkit/components/narrate/test/NarrateTestUtils.jsm
+++ b/toolkit/components/narrate/test/NarrateTestUtils.jsm
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://testing-common/ContentTaskUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { ContentTaskUtils } = Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
 
 this.EXPORTED_SYMBOLS = [ "NarrateTestUtils" ];
 
 this.NarrateTestUtils = {
   TOGGLE: "#narrate-toggle",
   POPUP: "#narrate-dropdown .dropdown-popup",
   VOICE_SELECT: "#narrate-voices .select-toggle",
   VOICE_OPTIONS: "#narrate-voices .options",
--- a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
+++ b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = [ "InsecurePasswordUtils" ];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 const STRINGS_URI = "chrome://global/locale/security/security.properties";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "devtools",
                                   "resource://devtools/shared/Loader.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "gContentSecurityManager",
                                    "@mozilla.org/contentsecuritymanager;1",
                                    "nsIContentSecurityManager");
 XPCOMUtils.defineLazyServiceGetter(this, "gScriptSecurityManager",
                                    "@mozilla.org/scriptsecuritymanager;1",
--- a/toolkit/components/passwordmgr/LoginHelper.jsm
+++ b/toolkit/components/passwordmgr/LoginHelper.jsm
@@ -16,18 +16,18 @@ this.EXPORTED_SYMBOLS = [
   "LoginHelper",
 ];
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 ////////////////////////////////////////////////////////////////////////////////
 //// LoginHelper
 
 /**
  * Contains functions shared by different Login Manager components.
  */
 this.LoginHelper = {
--- a/toolkit/components/passwordmgr/LoginImport.jsm
+++ b/toolkit/components/passwordmgr/LoginImport.jsm
@@ -18,18 +18,18 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 
--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
@@ -6,20 +6,20 @@
 
 this.EXPORTED_SYMBOLS = [ "LoginManagerContent",
                           "LoginFormFactory",
                           "UserAutoCompleteResult" ];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 const PASSWORD_INPUT_ADDED_COALESCING_THRESHOLD_MS = 1;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FormLikeFactory",
                                   "resource://gre/modules/FormLikeFactory.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginRecipesContent",
                                   "resource://gre/modules/LoginRecipes.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
--- a/toolkit/components/passwordmgr/LoginManagerContextMenu.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContextMenu.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["LoginManagerContextMenu"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerParent",
                                   "resource://gre/modules/LoginManagerParent.jsm");
 
 /*
  * Password manager object for the browser contextual menu.
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -2,19 +2,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties(["URL"]);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "UserAutoCompleteResult",
                                   "resource://gre/modules/LoginManagerContent.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AutoCompletePopup",
                                   "resource://gre/modules/AutoCompletePopup.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
--- a/toolkit/components/passwordmgr/LoginRecipes.jsm
+++ b/toolkit/components/passwordmgr/LoginRecipes.jsm
@@ -8,19 +8,19 @@ this.EXPORTED_SYMBOLS = ["LoginRecipesCo
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 const REQUIRED_KEYS = ["hosts"];
 const OPTIONAL_KEYS = ["description", "notUsernameSelector", "passwordSelector", "pathRegex", "usernameSelector"];
 const SUPPORTED_KEYS = REQUIRED_KEYS.concat(OPTIONAL_KEYS);
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "log", () => LoginHelper.createLogger("LoginRecipes"));
 
 /**
  * Create an instance of the object to manage recipes in the parent process.
--- a/toolkit/components/passwordmgr/LoginStore.jsm
+++ b/toolkit/components/passwordmgr/LoginStore.jsm
@@ -46,18 +46,18 @@ this.EXPORTED_SYMBOLS = [
   "LoginStore",
 ];
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "JSONFile",
                                   "resource://gre/modules/JSONFile.jsm");
 
 /**
  * Current data version assigned by the code that last touched the data.
  *
  * This number should be updated only when it is important to understand whether
--- a/toolkit/components/passwordmgr/OSCrypto_win.js
+++ b/toolkit/components/passwordmgr/OSCrypto_win.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes", "resource://gre/modules/ctypes.jsm");
 
 const FLAGS_NOT_SET = 0;
 
 const wintypes = {
   BOOL: ctypes.bool,
   BYTE: ctypes.uint8_t,
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*** =================== SAVED SIGNONS CODE =================== ***/
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 
 let kSignonBundle;
 
--- a/toolkit/components/passwordmgr/nsLoginInfo.js
+++ b/toolkit/components/passwordmgr/nsLoginInfo.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 
 
 function nsLoginInfo() {}
 
 nsLoginInfo.prototype = {
--- a/toolkit/components/passwordmgr/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/nsLoginManager.js
@@ -3,21 +3,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 const PERMISSION_SAVE_LOGINS = "login-saving";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/LoginManagerContent.jsm"); /*global UserAutoCompleteResult */
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { LoginManagerContent, UserAutoCompleteResult } = Cu.import("resource://gre/modules/LoginManagerContent.jsm", {});
+/*global UserAutoCompleteResult */
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
 const { PromptUtils } = Cu.import("resource://gre/modules/SharedPromptUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 
 const LoginInfo =
       Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                              "nsILoginInfo", "init");
--- a/toolkit/components/passwordmgr/storage-json.js
+++ b/toolkit/components/passwordmgr/storage-json.js
@@ -5,19 +5,19 @@
 /*
  * nsILoginManagerStorage implementation for the JSON back-end.
  */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginImport",
                                   "resource://gre/modules/LoginImport.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginStore",
                                   "resource://gre/modules/LoginStore.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
--- a/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
+++ b/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
@@ -9,21 +9,21 @@
 
 this.EXPORTED_SYMBOLS = [
   "LoginTestUtils",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-Cu.import("resource://testing-common/TestUtils.jsm");
+let { TestUtils } = Cu.import("resource://testing-common/TestUtils.jsm", {});
 
 const LoginInfo =
       Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                              "nsILoginInfo", "init");
 
 // For now, we need consumers to provide a reference to Assert.jsm.
 var Assert = null;
 
--- a/toolkit/components/passwordmgr/test/unit/head.js
+++ b/toolkit/components/passwordmgr/test/unit/head.js
@@ -4,20 +4,20 @@
 
 "use strict";
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LoginRecipes.jsm");
-Cu.import("resource://gre/modules/LoginHelper.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { LoginRecipesParent } = Cu.import("resource://gre/modules/LoginRecipes.jsm", {});
+let { LoginHelper } = Cu.import("resource://gre/modules/LoginHelper.jsm", {});
 Cu.import("resource://testing-common/MockDocument.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
--- a/toolkit/components/passwordmgr/test/unit/test_context_menu.js
+++ b/toolkit/components/passwordmgr/test/unit/test_context_menu.js
@@ -1,16 +1,16 @@
 /*
  * Test the password manager context menu.
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LoginManagerContextMenu.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { LoginManagerContextMenu } = Cu.import("resource://gre/modules/LoginManagerContextMenu.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "_stringBundle", function() {
   return Services.strings.
          createBundle("chrome://passwordmgr/locale/passwordmgr.properties");
 });
 
 /**
  * Prepare data for the following tests.
--- a/toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js
+++ b/toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js
@@ -1,15 +1,15 @@
 /*
  * Test LoginHelper.dedupeLogins
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/LoginHelper.jsm");
+let { LoginHelper } = Cu.import("resource://gre/modules/LoginHelper.jsm", {});
 
 const DOMAIN1_HTTP_TO_HTTP_U1_P1 = TestData.formLogin({
   timePasswordChanged: 3000,
   timeLastUsed: 2000,
 });
 const DOMAIN1_HTTP_TO_HTTP_U1_P2 = TestData.formLogin({
   password: "password two",
 });
--- a/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js
+++ b/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js
@@ -1,15 +1,15 @@
 /*
  * Test LoginHelper.isOriginMatching
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/LoginHelper.jsm");
+let { LoginHelper } = Cu.import("resource://gre/modules/LoginHelper.jsm", {});
 
 add_task(function test_isOriginMatching() {
   let testcases = [
     // Index 0 holds the expected return value followed by arguments to isOriginMatching.
     [true, "http://example.com", "http://example.com"],
     [true, "http://example.com:8080", "http://example.com:8080"],
     [true, "https://example.com", "https://example.com"],
     [true, "https://example.com:8443", "https://example.com:8443"],
--- a/toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js
+++ b/toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js
@@ -4,20 +4,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests the LoginImport object.
  */
 
 "use strict";
 
-////////////////////////////////////////////////////////////////////////////////
-//// Globals
-
-Cu.import("resource://gre/modules/Task.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
                                   "resource://gre/modules/LoginHelper.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginImport",
                                   "resource://gre/modules/LoginImport.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LoginStore",
                                   "resource://gre/modules/LoginStore.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
--- a/toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js
+++ b/toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js
@@ -58,12 +58,12 @@ add_task(function* test_remove_lagecy_si
   for (let setting of signonsSettings) {
     for (let singon of setting) {
       yield createSignonFile(singon);
     }
 
     LoginHelper.removeLegacySignonFiles();
 
     for (let singon of setting) {
-      equal(yield isSignonClear(singon), true);
+      equal((yield isSignonClear(singon)), true);
     }
   }
 });
--- a/toolkit/components/perfmonitoring/AddonWatcher.jsm
+++ b/toolkit/components/perfmonitoring/AddonWatcher.jsm
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["AddonWatcher"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "console",
                                   "resource://gre/modules/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PerformanceWatcher",
--- a/toolkit/components/places/BookmarkHTMLUtils.jsm
+++ b/toolkit/components/places/BookmarkHTMLUtils.jsm
@@ -57,23 +57,23 @@
  */
 
 this.EXPORTED_SYMBOLS = [ "BookmarkHTMLUtils" ];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
   "resource://gre/modules/PlacesBackups.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
   "resource://gre/modules/Deprecated.jsm");
 
 const Container_Normal = 0;
 const Container_Toolbar = 1;
--- a/toolkit/components/places/BookmarkJSONUtils.jsm
+++ b/toolkit/components/places/BookmarkJSONUtils.jsm
@@ -4,23 +4,23 @@
 
 this.EXPORTED_SYMBOLS = [ "BookmarkJSONUtils" ];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
   "resource://gre/modules/PlacesBackups.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
   "resource://gre/modules/Deprecated.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => new TextDecoder());
 XPCOMUtils.defineLazyGetter(this, "gTextEncoder", () => new TextEncoder());
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -59,17 +59,17 @@
  */
 
 this.EXPORTED_SYMBOLS = [ "Bookmarks" ];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
--- a/toolkit/components/places/ColorAnalyzer.js
+++ b/toolkit/components/places/ColorAnalyzer.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const XHTML_NS = "http://www.w3.org/1999/xhtml";
 const MAXIMUM_PIXELS = Math.pow(144, 2);
 
 function ColorAnalyzer() {
   // a queue of callbacks for each job we give to the worker
   this.callbacks = [];
 
--- a/toolkit/components/places/History.jsm
+++ b/toolkit/components/places/History.jsm
@@ -59,17 +59,17 @@
  * nsINavHistoryService `addObserver` and `removeObserver` methods.
  * @see nsINavHistoryObserver
  */
 
 this.EXPORTED_SYMBOLS = [ "History" ];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
--- a/toolkit/components/places/PageIconProtocolHandler.js
+++ b/toolkit/components/places/PageIconProtocolHandler.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 
 function makeDefaultFaviconChannel(uri, loadInfo) {
   let channel = Services.io.newChannelFromURIWithLoadInfo(
     PlacesUtils.favicons.defaultFavicon, loadInfo);
--- a/toolkit/components/places/PlacesBackups.jsm
+++ b/toolkit/components/places/PlacesBackups.jsm
@@ -5,21 +5,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["PlacesBackups"];
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cc = Components.classes;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 Cu.import("resource://gre/modules/NetUtil.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
   "resource://gre/modules/BookmarkJSONUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
   "resource://gre/modules/Deprecated.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
   "resource://gre/modules/osfile.jsm");
--- a/toolkit/components/places/PlacesDBUtils.jsm
+++ b/toolkit/components/places/PlacesDBUtils.jsm
@@ -4,19 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 this.EXPORTED_SYMBOLS = [ "PlacesDBUtils" ];
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Constants
 
 const FINISHED_MAINTENANCE_TOPIC = "places-maintenance-finished";
 
--- a/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm
+++ b/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm
@@ -8,18 +8,18 @@
  */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PlacesRemoteTabsAutocompleteProvider"];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "weaveXPCService", function() {
   return Cc["@mozilla.org/weave/service;1"]
            .getService(Ci.nsISupports)
            .wrappedJSObject;
 });
 
 XPCOMUtils.defineLazyGetter(this, "Weave", () => {
--- a/toolkit/components/places/PlacesSearchAutocompleteProvider.jsm
+++ b/toolkit/components/places/PlacesSearchAutocompleteProvider.jsm
@@ -7,20 +7,20 @@
  */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "PlacesSearchAutocompleteProvider" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "SearchSuggestionController",
   "resource://gre/modules/SearchSuggestionController.jsm");
 
 const SEARCH_ENGINE_TOPIC = "browser-search-engine-modified";
 
 const SearchAutocompleteProviderInternal = {
   /**
--- a/toolkit/components/places/PlacesSyncUtils.jsm
+++ b/toolkit/components/places/PlacesSyncUtils.jsm
@@ -5,17 +5,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PlacesSyncUtils"];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties(["URL", "URLSearchParams"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Log",
                                   "resource://gre/modules/Log.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
@@ -731,17 +731,17 @@ var updateSyncBookmark = Task.async(func
       delete updateInfo.parentSyncId;
     }
   }
 
   updateInfo = yield updateTagQueryFolder(updateInfo);
 
   let bookmarkInfo = syncBookmarkToPlacesBookmark(updateInfo);
   let newBookmarkItem = shouldUpdateBookmark(bookmarkInfo) ?
-                        yield PlacesUtils.bookmarks.update(bookmarkInfo) :
+                        (yield PlacesUtils.bookmarks.update(bookmarkInfo)) :
                         oldBookmarkItem;
   let newItem = yield updateBookmarkMetadata(oldBookmarkItem, newBookmarkItem,
                                              updateInfo);
 
   // If the item is an orphan, annotate it with its real parent sync ID.
   if (isOrphan) {
     yield annotateOrphan(newItem, requestedParentSyncId);
   }
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -24,18 +24,18 @@ this.EXPORTED_SYMBOLS = [
 , "PlacesTagURITransaction"
 , "PlacesUntagURITransaction"
 ];
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -241,21 +241,18 @@ const SQL_URL_QUERY = urlQuery();
 
 const SQL_TYPED_URL_QUERY = urlQuery("AND h.typed = 1");
 
 // TODO (bug 1045924): use foreign_count once available.
 const SQL_BOOKMARKED_URL_QUERY = urlQuery("AND bookmarked");
 
 const SQL_BOOKMARKED_TYPED_URL_QUERY = urlQuery("AND bookmarked AND h.typed = 1");
 
-////////////////////////////////////////////////////////////////////////////////
-//// Getters
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
                                   "resource://gre/modules/TelemetryStopwatch.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
--- a/toolkit/components/places/nsLivemarkService.js
+++ b/toolkit/components/places/nsLivemarkService.js
@@ -1,19 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-////////////////////////////////////////////////////////////////////////////////
-//// Modules and services.
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
                                   "resource://gre/modules/Deprecated.jsm");
--- a/toolkit/components/places/nsPlacesExpiration.js
+++ b/toolkit/components/places/nsPlacesExpiration.js
@@ -19,19 +19,19 @@
  * - Memory size of the device.
  * - Status of the database (clean or dirty).
  */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Constants
 
 // Last expiration step should run before the final sync.
--- a/toolkit/components/places/tests/PlacesTestUtils.jsm
+++ b/toolkit/components/places/tests/PlacesTestUtils.jsm
@@ -3,18 +3,18 @@
 this.EXPORTED_SYMBOLS = [
   "PlacesTestUtils",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 
 this.PlacesTestUtils = Object.freeze({
--- a/toolkit/components/places/tests/bookmarks/head_bookmarks.js
+++ b/toolkit/components/places/tests/bookmarks/head_bookmarks.js
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js
+++ b/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js
@@ -1,13 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that each nsINavBookmarksObserver method gets the correct input.
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
 
 const GUID_RE = /^[a-zA-Z0-9\-_]{12}$/;
 
 var gBookmarksObserver = {
   expected: [],
   setup(expected) {
     this.expected = expected;
     this.deferred = PromiseUtils.defer();
--- a/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
+++ b/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const CA = Cc["@mozilla.org/places/colorAnalyzer;1"].
            getService(Ci.mozIColorAnalyzer);
 
 const hiddenWindowDoc = Cc["@mozilla.org/appshell/appShellService;1"].
                         getService(Ci.nsIAppShellService).
                         hiddenDOMWindow.document;
 
--- a/toolkit/components/places/tests/expiration/head_expiration.js
+++ b/toolkit/components/places/tests/expiration/head_expiration.js
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/favicons/head_favicons.js
+++ b/toolkit/components/places/tests/favicons/head_favicons.js
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
+++ b/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
@@ -1,22 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This test ensures that the mime type is set for moz-anno channels of favicons
- * properly.  Added with work in bug 481227.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-//// Constants
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 const testFaviconData = "data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%06%00%00%00%1F%F3%FFa%00%00%00%04gAMA%00%00%AF%C87%05%8A%E9%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%D6IDATx%DAb%FC%FF%FF%3F%03%25%00%20%80%98%909%EF%DF%BFg%EF%EC%EC%FC%AD%AC%AC%FC%DF%95%91%F1%BF%89%89%C9%7F%20%FF%D7%EA%D5%AB%B7%DF%BBwO%16%9B%01%00%01%C4%00r%01%08%9F9s%C6%CD%D8%D8%F8%BF%0B%03%C3%FF3%40%BC%0A%88%EF%02q%1A%10%BB%40%F1%AAU%ABv%C1%D4%C30%40%00%81%89%993g%3E%06%1A%F6%3F%14%AA%11D%97%03%F1%7Fc%08%0D%E2%2B))%FD%17%04%89%A1%19%00%10%40%0C%D00%F8%0F3%00%C8%F8%BF%1B%E4%0Ac%88a%E5%60%17%19%FF%0F%0D%0D%05%1B%02v%D9%DD%BB%0A0%03%00%02%08%AC%B9%A3%A3%E3%17%03%D4v%90%01%EF%18%106%C3%0Cz%07%C5%BB%A1%DE%82y%07%20%80%A0%A6%08B%FCn%0C1%60%26%D4%20d%C3VA%C3%06%26%BE%0A%EA-%80%00%82%B9%E0%F7L4%0D%EF%90%F8%C6%60%2F%0A%82%BD%01%13%07%0700%D0%01%02%88%11%E4%02P%B41%DC%BB%C7%D0%014%0D%E8l%06W%20%06%BA%88%A1%1C%1AS%15%40%7C%16%CA6.%2Fgx%BFg%0F%83%CB%D9%B3%0C%7B%80%7C%80%00%02%BB%00%E8%9F%ED%20%1B%3A%A0%A6%9F%81%DA%DC%01%C5%B0%80%ED%80%FA%BF%BC%BC%FC%3F%83%12%90%9D%96%F6%1F%20%80%18%DE%BD%7B%C7%0E%8E%05AD%20%FEGr%A6%A0%A0%E0%7F%25P%80%02%9D%0F%D28%13%18%23%C6%C0%B0%02E%3D%C8%F5%00%01%04%8F%05P%A8%BA%40my%87%E4%12c%A8%8D%20%8B%D0%D3%00%08%03%04%10%9C%01R%E4%82d%3B%C8%A0%99%C6%90%90%C6%A5%19%84%01%02%08%9E%17%80%C9x%F7%7B%A0%DBVC%F9%A0%C0%5C%7D%16%2C%CE%00%F4%C6O%5C%99%09%20%800L%04y%A5%03%1A%95%A0%80%05%05%14.%DBA%18%20%80%18)%CD%CE%00%01%06%00%0C'%94%C7%C0k%C9%2C%00%00%00%00IEND%AEB%60%82";
 const moz_anno_favicon_prefix = "moz-anno:favicon:";
 
 ////////////////////////////////////////////////////////////////////////////////
 //// streamListener
 
 function streamListener(aExpectedContentType)
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -19,17 +19,17 @@ const TRANSITION_REDIRECT_PERMANENT = Ci
 const TRANSITION_REDIRECT_TEMPORARY = Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY;
 const TRANSITION_DOWNLOAD = Ci.nsINavHistoryService.TRANSITION_DOWNLOAD;
 const TRANSITION_RELOAD = Ci.nsINavHistoryService.TRANSITION_RELOAD;
 
 const TITLE_LENGTH_MAX = 4096;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
@@ -45,18 +45,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://testing-common/PlacesTestUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTransactions",
                                   "resource://gre/modules/PlacesTransactions.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
 
-// This imports various other objects in addition to PlacesUtils.
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "SMALLPNG_DATA_URI", function() {
   return NetUtil.newURI(
          "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAA" +
          "AAAA6fptVAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==");
 });
 XPCOMUtils.defineLazyGetter(this, "SMALLSVG_DATA_URI", function() {
   return NetUtil.newURI(
--- a/toolkit/components/places/tests/history/head_history.js
+++ b/toolkit/components/places/tests/history/head_history.js
@@ -4,16 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
--- a/toolkit/components/places/tests/history/test_insert.js
+++ b/toolkit/components/places/tests/history/test_insert.js
@@ -133,18 +133,18 @@ add_task(function* test_history_insert()
       Assert.equal(null, result.visits[0].referrer, "url of referrer for visit is correct");
     }
     if (date) {
       Assert.equal(Number(date),
                    Number(result.visits[0].date),
                    "date of visit is correct");
     }
 
-    Assert.ok(yield PlacesTestUtils.isPageInDB(uri), "Page was added");
-    Assert.ok(yield PlacesTestUtils.visitsInDB(uri), "Visit was added");
+    Assert.ok((yield PlacesTestUtils.isPageInDB(uri)), "Page was added");
+    Assert.ok((yield PlacesTestUtils.visitsInDB(uri)), "Visit was added");
   });
 
   try {
     for (let referrer of [TEST_URL, null]) {
       for (let date of [new Date(), null]) {
         for (let transition of [TRANSITION_LINK, null]) {
           yield inserter("Testing History.insert() with an nsIURI", x => x, referrer, date, transition);
           yield inserter("Testing History.insert() with a string url", x => x.spec, referrer, date, transition);
@@ -235,18 +235,18 @@ add_task(function* test_history_insertMa
     } else {
       result = yield PlacesUtils.history.insertMany(pageInfos);
     }
 
     Assert.equal(undefined, result, "insertMany returned undefined");
 
     for (let url of allUrls) {
       let expected = GOOD_URLS.includes(url);
-      Assert.equal(expected, yield PlacesTestUtils.isPageInDB(url), `isPageInDB for ${url} is ${expected}`);
-      Assert.equal(expected, yield PlacesTestUtils.visitsInDB(url), `visitsInDB for ${url} is ${expected}`);
+      Assert.equal(expected, (yield PlacesTestUtils.isPageInDB(url)), `isPageInDB for ${url} is ${expected}`);
+      Assert.equal(expected, (yield PlacesTestUtils.visitsInDB(url)), `visitsInDB for ${url} is ${expected}`);
     }
   });
 
   try {
     for (let useCallbacks of [false, true]) {
       yield inserter("Testing History.insertMany() with an nsIURI", x => x, useCallbacks);
       yield inserter("Testing History.insertMany() with a string url", x => x.spec, useCallbacks);
       yield inserter("Testing History.insertMany() with a URL object", x => new URL(x.spec), useCallbacks);
--- a/toolkit/components/places/tests/migration/head_migration.js
+++ b/toolkit/components/places/tests/migration/head_migration.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict"
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/network/head_network.js
+++ b/toolkit/components/places/tests/network/head_network.js
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/queries/head_queries.js
+++ b/toolkit/components/places/tests/queries/head_queries.js
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
@@ -4,18 +4,18 @@
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
 const FRECENCY_DEFAULT = 10000;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/unifiedcomplete/test_remotetabmatches.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_remotetabmatches.js
@@ -1,14 +1,14 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
  * vim:set ts=2 sw=2 sts=2 et:
 */
 "use strict";
 
-Cu.import("resource://services-sync/main.js");
+let { Weave } = Cu.import("resource://services-sync/main.js", {});
 
 Services.prefs.setCharPref("services.sync.username", "someone@somewhere.com");
 
 // A mock "Tabs" engine which autocomplete will use instead of the real
 // engine. We pass a constructor that Sync creates.
 function MockTabsEngine() {
   this.clients = null; // We'll set this dynamically
 }
--- a/toolkit/components/places/tests/unit/head_bookmarks.js
+++ b/toolkit/components/places/tests/unit/head_bookmarks.js
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Import common head.
 {
   let commonFile = do_get_file("../head_common.js", false);
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/toolkit/components/places/tests/unit/test_1105866.js
+++ b/toolkit/components/places/tests/unit/test_1105866.js
@@ -4,32 +4,32 @@ add_task(function* test_folder_shortcuts
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
     url: "place:folder=TOOLBAR"
   });
 
   let unfiledRoot =
     PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
   let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
   Assert.strictEqual(shortcutNode.itemId,
-                     yield PlacesUtils.promiseItemId(shortcutInfo.guid));
+                     (yield PlacesUtils.promiseItemId(shortcutInfo.guid)));
   Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).folderItemId,
                      PlacesUtils.toolbarFolderId);
   Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
   Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
                      PlacesUtils.bookmarks.toolbarGuid);
 
   // test that a node added incrementally also behaves just as well.
   shortcutInfo = yield PlacesUtils.bookmarks.insert({
     type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
     url: "place:folder=BOOKMARKS_MENU"
   });
   shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
   Assert.strictEqual(shortcutNode.itemId,
-                     yield PlacesUtils.promiseItemId(shortcutInfo.guid));
+                     (yield PlacesUtils.promiseItemId(shortcutInfo.guid)));
   Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).folderItemId,
                      PlacesUtils.bookmarksMenuFolderId);
   Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
   Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
                      PlacesUtils.bookmarks.menuGuid);
 
   unfiledRoot.containerOpen = false;
 });
--- a/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js
+++ b/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/PlacesSearchAutocompleteProvider.jsm");
+let { PlacesSearchAutocompleteProvider } = Cu.import("resource://gre/modules/PlacesSearchAutocompleteProvider.jsm", {});
 
 function run_test() {
   // Tell the search service we are running in the US.  This also has the
   // desired side-effect of preventing our geoip lookup.
   Services.prefs.setBoolPref("browser.search.isUS", true);
   Services.prefs.setCharPref("browser.search.countryCode", "US");
   Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", false);
   run_next_test();
@@ -18,43 +14,43 @@ add_task(function* search_engine_match()
   let token = engine.getResultDomain();
   let match = yield PlacesSearchAutocompleteProvider.findMatchByToken(token.substr(0, 1));
   do_check_eq(match.url, engine.searchForm);
   do_check_eq(match.engineName, engine.name);
   do_check_eq(match.iconUrl, engine.iconURI ? engine.iconURI.spec : null);
 });
 
 add_task(function* no_match() {
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("test"));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByToken("test")));
 });
 
 add_task(function* hide_search_engine_nomatch() {
   let engine = yield promiseDefaultSearchEngine();
   let token = engine.getResultDomain();
   let promiseTopic = promiseSearchTopic("engine-changed");
   Services.search.removeEngine(engine);
   yield promiseTopic;
   do_check_true(engine.hidden);
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken(token.substr(0, 1)));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByToken(token.substr(0, 1))));
 });
 
 add_task(function* add_search_engine_match() {
   let promiseTopic = promiseSearchTopic("engine-added");
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon"));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon")));
   Services.search.addEngineWithDetails("bacon", "", "pork", "Search Bacon",
                                        "GET", "http://www.bacon.moz/?search={searchTerms}");
   yield promiseSearchTopic;
   let match = yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon");
   do_check_eq(match.url, "http://www.bacon.moz");
   do_check_eq(match.engineName, "bacon");
   do_check_eq(match.iconUrl, null);
 });
 
 add_task(function* test_aliased_search_engine_match() {
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByAlias("sober"));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByAlias("sober")));
   // Lower case
   let match = yield PlacesSearchAutocompleteProvider.findMatchByAlias("pork");
   do_check_eq(match.engineName, "bacon");
   do_check_eq(match.alias, "pork");
   do_check_eq(match.iconUrl, null);
   // Upper case
   let match1 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("PORK");
   do_check_eq(match1.engineName, "bacon");
@@ -64,17 +60,17 @@ add_task(function* test_aliased_search_e
   let match2 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("Pork");
   do_check_eq(match2.engineName, "bacon");
   do_check_eq(match2.alias, "pork");
   do_check_eq(match2.iconUrl, null);
 });
 
 add_task(function* test_aliased_search_engine_match_upper_case_alias() {
   let promiseTopic = promiseSearchTopic("engine-added");
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("patch"));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByToken("patch")));
   Services.search.addEngineWithDetails("patch", "", "PR", "Search Patch",
                                        "GET", "http://www.patch.moz/?search={searchTerms}");
   yield promiseSearchTopic;
   // lower case
   let match = yield PlacesSearchAutocompleteProvider.findMatchByAlias("pr");
   do_check_eq(match.engineName, "patch");
   do_check_eq(match.alias, "PR");
   do_check_eq(match.iconUrl, null);
@@ -90,17 +86,17 @@ add_task(function* test_aliased_search_e
   do_check_eq(match2.iconUrl, null);
 });
 
 add_task(function* remove_search_engine_nomatch() {
   let engine = Services.search.getEngineByName("bacon");
   let promiseTopic = promiseSearchTopic("engine-removed");
   Services.search.removeEngine(engine);
   yield promiseTopic;
-  do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon"));
+  do_check_eq(null, (yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon")));
 });
 
 add_task(function* test_parseSubmissionURL_basic() {
   // Most of the logic of parseSubmissionURL is tested in the search service
   // itself, thus we only do a sanity check of the wrapper here.
   let engine = yield promiseDefaultSearchEngine();
   let submissionURL = engine.getSubmission("terms").uri.spec;
 
--- a/toolkit/components/places/tests/unit/test_async_in_batchmode.js
+++ b/toolkit/components/places/tests/unit/test_async_in_batchmode.js
@@ -1,14 +1,9 @@
-// This is testing the frankenstein situation Sync forces Places into.
-// Sync does runInBatchMode() and before the callback returns the Places async
-// APIs are used (either by Sync itself, or by any other code in the system)
-// As seen in bug 1197856 and bug 1190131.
-
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
 
 // This function "waits" for a promise to resolve by spinning a nested event
 // loop.
 function waitForPromise(promise) {
   let thread = Cc["@mozilla.org/thread-manager;1"].getService().currentThread;
 
   let finalResult, finalException;
 
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js
@@ -1,18 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Test for bug #801450
-
-// Get Services
-Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
+let { BookmarkHTMLUtils } = Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm", {});
 
 function run_test()
 {
   run_next_test();
 }
 
 add_task(function* test_bookmarks_html_singleframe()
 {
--- a/toolkit/components/places/tests/unit/test_bookmarks_json.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_json.js
@@ -1,13 +1,9 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm");
+let { BookmarkJSONUtils } = Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm", {});
 
 function run_test() {
   run_next_test();
 }
 
 const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
 const DESCRIPTION_ANNO = "bookmarkProperties/description";
 
--- a/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
@@ -1,15 +1,9 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
+let { BookmarkHTMLUtils } = Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm", {});
 
 /**
  * Tests the bookmarks-restore-* nsIObserver notifications after restoring
  * bookmarks from JSON and HTML.  See bug 470314.
  */
 
 // The topics and data passed to nsIObserver.observe() on bookmarks restore
 const NSIOBSERVER_TOPIC_BEGIN    = "bookmarks-restore-begin";
--- a/toolkit/components/places/tests/unit/test_keywords.js
+++ b/toolkit/components/places/tests/unit/test_keywords.js
@@ -1,30 +1,30 @@
 "use strict"
 
 function* check_keyword(aExpectExists, aHref, aKeyword, aPostData = null) {
   // Check case-insensitivity.
   aKeyword = aKeyword.toUpperCase();
 
   let entry = yield PlacesUtils.keywords.fetch(aKeyword);
 
-  Assert.deepEqual(entry, yield PlacesUtils.keywords.fetch({ keyword: aKeyword }));
+  Assert.deepEqual(entry, (yield PlacesUtils.keywords.fetch({ keyword: aKeyword })));
 
   if (aExpectExists) {
     Assert.ok(!!entry, "A keyword should exist");
     Assert.equal(entry.url.href, aHref);
     Assert.equal(entry.postData, aPostData);
-    Assert.deepEqual(entry, yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref }));
+    Assert.deepEqual(entry, (yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref })));
     let entries = [];
     yield PlacesUtils.keywords.fetch({ url: aHref }, e => entries.push(e));
     Assert.ok(entries.some(e => e.url.href == aHref && e.keyword == aKeyword.toLowerCase()));
   } else {
     Assert.ok(!entry || entry.url.href != aHref,
               "The given keyword entry should not exist");
-    Assert.equal(null, yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref }));
+    Assert.equal(null, (yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref })));
   }
 }
 
 /**
  * Polls the keywords cache waiting for the given keyword entry.
  */
 function* promiseKeyword(keyword, expectedHref) {
   let href = null;
--- a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
+++ b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
@@ -144,17 +144,17 @@ function* compareToNode(aItem, aNode, aI
       else {
         check_unset(aItem.iconuri);
       }
 
       check_unset(...FOLDER_ONLY_PROPS);
 
       let itemURI = uri(aNode.uri);
       compare_prop_to_value("charset",
-                            yield PlacesUtils.getCharsetForURI(itemURI));
+                            (yield PlacesUtils.getCharsetForURI(itemURI)));
 
       let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
       compare_prop_to_value("keyword", entry ? entry.keyword : null);
 
       if ("title" in aItem)
         compare_prop("title");
       else
         do_check_null(aNode.title);
@@ -201,17 +201,17 @@ function* test_promiseBookmarksTreeForEa
   }
   return item;
 }
 
 function* test_promiseBookmarksTreeAgainstResult(aItemGuid = "",
                                                  aOptions = { includeItemIds: true },
                                                  aExcludedGuids) {
   let itemId = aItemGuid ?
-    yield PlacesUtils.promiseItemId(aItemGuid) : PlacesUtils.placesRootId;
+    (yield PlacesUtils.promiseItemId(aItemGuid)) : PlacesUtils.placesRootId;
   let node = PlacesUtils.getFolderContents(itemId).root;
   return yield test_promiseBookmarksTreeForEachNode(node, aOptions, aExcludedGuids);
 }
 
 add_task(function* () {
   // Add some bookmarks to cover various use cases.
   yield new_bookmark({ parentGuid: PlacesUtils.bookmarks.toolbarGuid });
   yield new_folder({ parentGuid: PlacesUtils.bookmarks.menuGuid,
--- a/toolkit/components/places/tests/unit/test_sync_utils.js
+++ b/toolkit/components/places/tests/unit/test_sync_utils.js
@@ -1,10 +1,10 @@
-Cu.import("resource://gre/modules/PlacesSyncUtils.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { PlacesSyncUtils } = Cu.import("resource://gre/modules/PlacesSyncUtils.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 Cu.importGlobalProperties(["crypto", "URLSearchParams"]);
 
 const DESCRIPTION_ANNO = "bookmarkProperties/description";
 const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
 const SYNC_PARENT_ANNO = "sync/parent";
 
 function makeGuid() {
   return ChromeUtils.base64URLEncode(crypto.getRandomValues(new Uint8Array(9)), {
@@ -87,17 +87,17 @@ var populateTree = Task.async(function* 
 
       case "folder":
         yield PlacesUtils.bookmarks.insert({
           type: PlacesUtils.bookmarks.TYPE_FOLDER,
           title: item.title,
           parentGuid, guid,
         });
         if (item.children) {
-          Object.assign(guids, yield* populate(guid, ...item.children));
+          Object.assign(guids, (yield* populate(guid, ...item.children)));
         }
         break;
 
       default:
         throw new Error(`Unsupported item type: ${item.type}`);
     }
 
     if (item.exclude) {
@@ -191,19 +191,19 @@ add_task(function* test_changeGuid() {
     url: "https://mozilla.org",
   });
   let id = yield PlacesUtils.promiseItemId(item.guid);
 
   let newGuid = makeGuid();
   let result = yield PlacesSyncUtils.bookmarks.changeGuid(item.guid, newGuid);
   equal(result, newGuid, "Should return new GUID");
 
-  equal(yield PlacesUtils.promiseItemId(newGuid), id, "Should map ID to new GUID");
+  equal((yield PlacesUtils.promiseItemId(newGuid)), id, "Should map ID to new GUID");
   yield rejects(PlacesUtils.promiseItemId(item.guid), "Should not map ID to old GUID");
-  equal(yield PlacesUtils.promiseItemGuid(id), newGuid, "Should map new GUID to ID");
+  equal((yield PlacesUtils.promiseItemGuid(id)), newGuid, "Should map new GUID to ID");
 });
 
 add_task(function* test_order_roots() {
   let oldOrder = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
     PlacesUtils.bookmarks.rootGuid);
   yield PlacesSyncUtils.bookmarks.order(PlacesUtils.bookmarks.rootGuid,
     shuffle(oldOrder));
   let newOrder = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
@@ -546,36 +546,36 @@ add_task(function* test_update_livemark(
       });
 
       yield PlacesSyncUtils.bookmarks.update({
         syncId: livemark.guid,
         feed: feedURI,
       });
       // `nsLivemarkService` returns references to `Livemark` instances, so we
       // can compare them with `==` to make sure they haven't been replaced.
-      equal(yield PlacesUtils.livemarks.getLivemark({
+      equal((yield PlacesUtils.livemarks.getLivemark({
         guid: livemark.guid,
-      }), livemark, "Livemark with same feed URL should not be replaced");
+      })), livemark, "Livemark with same feed URL should not be replaced");
 
       yield PlacesSyncUtils.bookmarks.update({
         syncId: livemark.guid,
         site,
       });
-      equal(yield PlacesUtils.livemarks.getLivemark({
+      equal((yield PlacesUtils.livemarks.getLivemark({
         guid: livemark.guid,
-      }), livemark, "Livemark with same site URL should not be replaced");
+      })), livemark, "Livemark with same site URL should not be replaced");
 
       yield PlacesSyncUtils.bookmarks.update({
         syncId: livemark.guid,
         feed: feedURI,
         site,
       });
-      equal(yield PlacesUtils.livemarks.getLivemark({
+      equal((yield PlacesUtils.livemarks.getLivemark({
         guid: livemark.guid,
-      }), livemark, "Livemark with same feed and site URLs should not be replaced");
+      })), livemark, "Livemark with same feed and site URLs should not be replaced");
     }
 
     do_print("Change livemark feed URL");
     {
       let livemark = yield PlacesUtils.livemarks.addLivemark({
         parentGuid: PlacesUtils.bookmarks.menuGuid,
         feedURI,
         index: PlacesUtils.bookmarks.DEFAULT_INDEX,
--- a/toolkit/components/places/tests/unit/test_visitsInDB.js
+++ b/toolkit/components/places/tests/unit/test_visitsInDB.js
@@ -1,12 +1,12 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 
 add_task(function* test_execute() {
   const TEST_URI = uri("http://mozilla.com");
 
-  do_check_eq(0, yield PlacesTestUtils.visitsInDB(TEST_URI));
+  do_check_eq(0, (yield PlacesTestUtils.visitsInDB(TEST_URI)));
   yield PlacesTestUtils.addVisits({uri: TEST_URI});
-  do_check_eq(1, yield PlacesTestUtils.visitsInDB(TEST_URI));
+  do_check_eq(1, (yield PlacesTestUtils.visitsInDB(TEST_URI)));
   yield PlacesTestUtils.addVisits({uri: TEST_URI});
-  do_check_eq(2, yield PlacesTestUtils.visitsInDB(TEST_URI));
+  do_check_eq(2, (yield PlacesTestUtils.visitsInDB(TEST_URI)));
 });
--- a/toolkit/components/privatebrowsing/PrivateBrowsingTrackingProtectionWhitelist.js
+++ b/toolkit/components/privatebrowsing/PrivateBrowsingTrackingProtectionWhitelist.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function PrivateBrowsingTrackingProtectionWhitelist() {
   // The list of URIs explicitly excluded from tracking protection.
   this._allowlist = [];
 
   Services.obs.addObserver(this, "last-pb-context-exited", true);
 }
 
--- a/toolkit/components/processsingleton/ContentProcessSingleton.js
+++ b/toolkit/components/processsingleton/ContentProcessSingleton.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
 
 /*
  * The message manager has an upper limit on message sizes that it can
  * reliably forward to the parent so we limit the size of console log event
--- a/toolkit/components/processsingleton/MainProcessSingleton.js
+++ b/toolkit/components/processsingleton/MainProcessSingleton.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { utils: Cu, interfaces: Ci, classes: Cc, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 
 function MainProcessSingleton() {}
 MainProcessSingleton.prototype = {
   classID: Components.ID("{0636a680-45cb-11e4-916c-0800200c9a66}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
--- a/toolkit/components/prompts/content/commonDialog.js
+++ b/toolkit/components/prompts/content/commonDialog.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cr = Components.results;
 var Cc = Components.classes;
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/CommonDialog.jsm");
+let { CommonDialog } = Cu.import("resource://gre/modules/CommonDialog.jsm", {});
 
 var propBag, args, Dialog;
 
 function commonDialogOnLoad() {
     propBag = window.arguments[0].QueryInterface(Ci.nsIWritablePropertyBag2)
                                  .QueryInterface(Ci.nsIWritablePropertyBag);
     // Convert to a JS object
     args = {};
--- a/toolkit/components/prompts/src/CommonDialog.jsm
+++ b/toolkit/components/prompts/src/CommonDialog.jsm
@@ -4,18 +4,18 @@
 
 this.EXPORTED_SYMBOLS = ["CommonDialog"];
 
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "EnableDelayHelper",
                                   "resource://gre/modules/SharedPromptUtils.jsm");
 
 
 this.CommonDialog = function CommonDialog(args, ui) {
     this.args = args;
     this.ui   = ui;
 }
--- a/toolkit/components/prompts/src/SharedPromptUtils.jsm
+++ b/toolkit/components/prompts/src/SharedPromptUtils.jsm
@@ -1,16 +1,16 @@
 this.EXPORTED_SYMBOLS = [ "PromptUtils", "EnableDelayHelper" ];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 this.PromptUtils = {
     // Fire a dialog open/close event. Used by tabbrowser to focus the
     // tab which is triggering a prompt.
     // For remote dialogs, we pass in a different DOM window and a separate
     // target. If the caller doesn't pass in the target, then we'll simply use
     // the passed-in DOM window.
     // The detail may contain information about the principal on which the
--- a/toolkit/components/prompts/src/nsPrompter.js
+++ b/toolkit/components/prompts/src/nsPrompter.js
@@ -4,19 +4,19 @@
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/SharedPromptUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PromptUtils } = Cu.import("resource://gre/modules/SharedPromptUtils.jsm", {});
 
 function Prompter() {
     // Note that EmbedPrompter clones this implementation.
 }
 
 Prompter.prototype = {
     classID          : Components.ID("{1c978d25-b37f-43a8-a2d6-0c7a239ead87}"),
     QueryInterface   : XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIPromptService, Ci.nsIPromptService2]),
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "AboutReader" ];
 
-Cu.import("resource://gre/modules/ReaderMode.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { ReaderMode } = Cu.import("resource://gre/modules/ReaderMode.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncPrefs", "resource://gre/modules/AsyncPrefs.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NarrateControls", "resource://gre/modules/narrate/NarrateControls.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry", "resource://gre/modules/UITelemetry.jsm");
 
 var gStrings = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -13,18 +13,18 @@ const DOWNLOAD_SUCCESS = 0;
 const DOWNLOAD_ERROR_XHR = 1;
 const DOWNLOAD_ERROR_NO_DOC = 2;
 
 const PARSE_SUCCESS = 0;
 const PARSE_ERROR_TOO_MANY_ELEMENTS = 1;
 const PARSE_ERROR_WORKER = 2;
 const PARSE_ERROR_NO_ARTICLE = 3;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils", "resource://services-common/utils.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Messaging", "resource://gre/modules/Messaging.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderWorker", "resource://gre/modules/reader/ReaderWorker.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
--- a/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
+++ b/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
@@ -1,16 +1,16 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 const { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 
 function makeURI(url)
 {
--- a/toolkit/components/satchel/AutoCompletePopup.jsm
+++ b/toolkit/components/satchel/AutoCompletePopup.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "AutoCompletePopup" ];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // AutoCompleteResultView is an abstraction around a list of results
 // we got back up from browser-content.js. It implements enough of
 // nsIAutoCompleteController and nsIAutoCompleteInput to make the
 // richlistbox popup work.
 var AutoCompleteResultView = {
   // nsISupports
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteController,
--- a/toolkit/components/satchel/nsFormAutoComplete.js
+++ b/toolkit/components/satchel/nsFormAutoComplete.js
@@ -2,18 +2,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
                                   "resource://gre/modules/Deprecated.jsm");
 
 function isAutocompleteDisabled(aField) {
     if (aField.autocomplete !== "") {
--- a/toolkit/components/satchel/test/parent_utils.js
+++ b/toolkit/components/satchel/test/parent_utils.js
@@ -1,13 +1,13 @@
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/FormHistory.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/ContentTaskUtils.jsm");
+let { FormHistory } = Cu.import("resource://gre/modules/FormHistory.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { ContentTaskUtils } = Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
 
 var gAutocompletePopup = Services.ww.activeWindow.
                                    document.
                                    getElementById("PopupAutoComplete");
 assert.ok(gAutocompletePopup, "Got autocomplete popup");
 
 var ParentUtils = {
   getMenuEntries() {
--- a/toolkit/components/satchel/test/unit/test_history_api.js
+++ b/toolkit/components/satchel/test/unit/test_history_api.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var testnum = 0;
 var dbConnection; // used for deleted table tests
 
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 function countDeletedEntries(expected)
 {
   let deferred = Promise.defer();
   let stmt = dbConnection.createAsyncStatement("SELECT COUNT(*) AS numEntries FROM moz_deleted_formhistory");
   stmt.executeAsync({
     handleResult: function(resultSet) {
       do_check_eq(expected, resultSet.getNextRow().getResultByName("numEntries"));
--- a/toolkit/components/search/SearchSuggestionController.jsm
+++ b/toolkit/components/search/SearchSuggestionController.jsm
@@ -3,19 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["SearchSuggestionController"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "NS_ASSERT", "resource://gre/modules/debug.js");
 
 const SEARCH_RESPONSE_SUGGESTION_JSON = "application/x-suggestions+json";
 const DEFAULT_FORM_HISTORY_PARAM      = "searchbar-history";
 const HTTP_OK            = 200;
 const REMOTE_TIMEOUT     = 500; // maximum time (ms) to wait before giving up on a remote suggestions
 const BROWSER_SUGGEST_PREF = "browser.search.suggest.enabled";
 
--- a/toolkit/components/search/nsSearchSuggestions.js
+++ b/toolkit/components/search/nsSearchSuggestions.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { FormAutoCompleteResult } = Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "SearchSuggestionController",
                                   "resource://gre/modules/SearchSuggestionController.jsm");
 
 /**
  * SuggestAutoComplete is a base class that implements nsIAutoCompleteSearch
  * and can collect results for a given search by using this._suggestionController.
  * We do it this way since the AutoCompleteController in Mozilla requires a
  * unique XPCOM Service for every search provider, even if the logic for two
--- a/toolkit/components/search/nsSidebar.js
+++ b/toolkit/components/search/nsSidebar.js
@@ -1,16 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 // File extension for Sherlock search plugin description files
 const SHERLOCK_FILE_EXT_REGEXP = /\.src$/i;
 
 function nsSidebar() {
 }
 
 nsSidebar.prototype = {
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -1,22 +1,22 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://testing-common/AppInfo.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { updateAppInfo } = Cu.import("resource://testing-common/AppInfo.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 const BROWSER_SEARCH_PREF = "browser.search.";
 const NS_APP_SEARCH_DIR = "SrchPlugns";
 
 const MODE_RDONLY = FileUtils.MODE_RDONLY;
 const MODE_WRONLY = FileUtils.MODE_WRONLY;
 const MODE_CREATE = FileUtils.MODE_CREATE;
 const MODE_TRUNCATE = FileUtils.MODE_TRUNCATE;
--- a/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
+++ b/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
@@ -2,19 +2,19 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Testing search suggestions from SearchSuggestionController.jsm.
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/FormHistory.jsm");
-Cu.import("resource://gre/modules/SearchSuggestionController.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { FormHistory } = Cu.import("resource://gre/modules/FormHistory.jsm", {});
+let { SearchSuggestionController } = Cu.import("resource://gre/modules/SearchSuggestionController.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 // We must make sure the FormHistoryStartup component is
 // initialized in order for it to respond to FormHistory
 // requests from nsFormAutoComplete.js.
 var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"].
                          getService(Ci.nsIObserver);
 formHistoryStartup.observe(null, "profile-after-change", null);
 
--- a/toolkit/components/telemetry/TelemetryController.jsm
+++ b/toolkit/components/telemetry/TelemetryController.jsm
@@ -6,29 +6,29 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 const myScope = this;
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 Cu.import("resource://gre/modules/debug.js", this);
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/osfile.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
 Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/DeferredTask.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 Cu.import("resource://gre/modules/Timer.jsm");
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const Utils = TelemetryUtils;
 
 const LOGGER_NAME = "Toolkit.Telemetry";
 const LOGGER_PREFIX = "TelemetryController::";
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_BRANCH_LOG = PREF_BRANCH + "log.";
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -7,25 +7,25 @@
 this.EXPORTED_SYMBOLS = [
   "TelemetryEnvironment",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 const myScope = this;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-Cu.import("resource://gre/modules/ObjectUtils.jsm");
+let { ObjectUtils } = Cu.import("resource://gre/modules/ObjectUtils.jsm", {});
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const Utils = TelemetryUtils;
 
 XPCOMUtils.defineLazyModuleGetter(this, "AttributionCode",
                                   "resource:///modules/AttributionCode.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 if (AppConstants.platform !== "gonk") {
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -15,18 +15,18 @@ this.EXPORTED_SYMBOLS = [
   "TelemetrySend",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/Log.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
 Cu.import("resource://gre/modules/Timer.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStorage",
                                   "resource://gre/modules/TelemetryStorage.jsm");
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -6,27 +6,27 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/debug.js", this);
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
 Cu.import("resource://gre/modules/DeferredTask.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const Utils = TelemetryUtils;
 
 const myScope = this;
 
 // When modifying the payload in incompatible ways, please bump this version number
 const PAYLOAD_VERSION = 4;
 const PING_TYPE_MAIN = "main";
--- a/toolkit/components/telemetry/TelemetryStorage.jsm
+++ b/toolkit/components/telemetry/TelemetryStorage.jsm
@@ -8,17 +8,17 @@
 this.EXPORTED_SYMBOLS = ["TelemetryStorage"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/AppConstants.jsm", this);
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/osfile.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
 Cu.import("resource://gre/modules/Preferences.jsm", this);
 
--- a/toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm
+++ b/toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm
@@ -1,13 +1,13 @@
 const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/TelemetryArchive.jsm");
+let { TelemetryArchive } = Cu.import("resource://gre/modules/TelemetryArchive.jsm", {});
 Cu.import("resource://testing-common/Assert.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/TelemetryController.jsm");
 
 this.EXPORTED_SYMBOLS = [
   "TelemetryArchiveTesting",
 ];
 
 function checkForProperties(ping, expected) {
   for (let [props, val] of expected) {
--- a/toolkit/components/telemetry/tests/unit/head.js
+++ b/toolkit/components/telemetry/tests/unit/head.js
@@ -5,17 +5,17 @@ var { classes: Cc, utils: Cu, interfaces
 
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/FileUtils.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://testing-common/httpd.js", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonTestUtils",
                                   "resource://testing-common/AddonTestUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 
 const gIsWindows = AppConstants.platform == "win";
 const gIsMac = AppConstants.platform == "macosx";
--- a/toolkit/components/telemetry/tests/unit/test_PingAPI.js
+++ b/toolkit/components/telemetry/tests/unit/test_PingAPI.js
@@ -457,17 +457,17 @@ add_task(function* test_InvalidPayloadTy
     undefined,
   ];
 
   let histogram = Telemetry.getHistogramById("TELEMETRY_INVALID_PAYLOAD_SUBMITTED");
   for (let i = 0; i < PAYLOAD_TYPES.length; i++) {
     histogram.clear();
     Assert.equal(histogram.snapshot().sum, 0,
       "Should not have counted this invalid payload yet: " + JSON.stringify(PAYLOAD_TYPES[i]));
-    Assert.ok(yield promiseRejects(TelemetryController.submitExternalPing("payload-test", PAYLOAD_TYPES[i])),
+    Assert.ok((yield promiseRejects(TelemetryController.submitExternalPing("payload-test", PAYLOAD_TYPES[i]))),
       "Payload type should have been rejected.");
     Assert.equal(histogram.snapshot().sum, 1,
       "Should have counted this as an invalid payload type.");
   }
 });
 
 add_task(function* test_currentPingData() {
   yield TelemetryController.testSetup();
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
@@ -1,28 +1,18 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* This testcase triggers two telemetry pings.
- *
- * Telemetry code keeps histograms of past telemetry pings. The first
- * ping populates these histograms. One of those histograms is then
- * checked in the second request.
- */
-
-Cu.import("resource://gre/modules/ClientID.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ClientID } = Cu.import("resource://gre/modules/ClientID.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
 Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
 Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
 Cu.import("resource://gre/modules/TelemetryArchive.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 const PING_FORMAT_VERSION = 4;
 const DELETION_PING_TYPE = "deletion";
 const TEST_PING_TYPE = "test-ping-type";
 
 const PLATFORM_VERSION = "1.9.2";
 const APP_VERSION = "1";
 const APP_NAME = "XPCShell";
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -1,20 +1,17 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/AddonManager.jsm");
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
 Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
 Cu.import("resource://gre/modules/Preferences.jsm", this);
 Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://testing-common/AddonManagerTesting.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { AddonManagerTesting } = Cu.import("resource://testing-common/AddonManagerTesting.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 Cu.import("resource://testing-common/MockRegistrar.jsm", this);
-Cu.import("resource://gre/modules/FileUtils.jsm");
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
 
 // AttributionCode is only needed for Firefox
 XPCOMUtils.defineLazyModuleGetter(this, "AttributionCode",
                                   "resource:///modules/AttributionCode.jsm");
 
 // Lazy load |LightweightThemeManager|, we won't be using it on Gonk.
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -4,28 +4,28 @@
 /* This testcase triggers two telemetry pings.
  *
  * Telemetry code keeps histograms of past telemetry pings. The first
  * ping populates these histograms. One of those histograms is then
  * checked in the second request.
  */
 
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/ClientID.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { ClientID } = Cu.import("resource://gre/modules/ClientID.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/LightweightThemeManager.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
 Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
 Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
 Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
 Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
 Cu.import("resource://gre/modules/Task.jsm", this);
 Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 Cu.import("resource://gre/modules/osfile.jsm", this);
 
 const PING_FORMAT_VERSION = 4;
 const PING_TYPE_MAIN = "main";
 const PING_TYPE_SAVED_SESSION = "saved-session";
 
 const REASON_ABORTED_SESSION = "aborted-session";
 const REASON_SAVED_SESSION = "saved-session";
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js
@@ -1,23 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var Cu = Components.utils;
 var Cc = Components.classes;
 var Ci = Components.interfaces;
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/TelemetryController.jsm", this);
 Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 
-// The @mozilla/xre/app-info;1 XPCOM object provided by the xpcshell test harness doesn't
-// implement the nsIXULAppInfo interface, which is needed by Services.jsm and
-// TelemetrySession.jsm. updateAppInfo() creates and registers a minimal mock app-info.
-Cu.import("resource://testing-common/AppInfo.jsm");
+let { updateAppInfo } = Cu.import("resource://testing-common/AppInfo.jsm", {});
 updateAppInfo();
 
 var gGlobalScope = this;
 
 function getSimpleMeasurementsFromTelemetryController() {
   return TelemetrySession.getPayload().simpleMeasurements;
 }
 
--- a/toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js
+++ b/toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js
@@ -1,12 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function getMainThreadHangStats() {
   let threads = Services.telemetry.threadHangStats;
   return threads.find((thread) => (thread.name === "Gecko"));
 }
 
 function run_test() {
   let startHangs = getMainThreadHangStats();
--- a/toolkit/components/terminator/nsTerminatorTelemetry.js
+++ b/toolkit/components/terminator/nsTerminatorTelemetry.js
@@ -11,17 +11,17 @@
  * relevant telemetry histograms.
  */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -15,19 +15,19 @@ const TELEMETRY_HISTOGRAM_ID_PREFIX = "F
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 
 const ABOUT_NEWTAB_SEGREGATION_PREF = "privacy.usercontext.about_newtab_segregation.enabled";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/PageThumbs.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { PageThumbs, PageThumbsStorage } = Cu.import("resource://gre/modules/PageThumbs.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 // possible FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2 telemetry values
 const TEL_CAPTURE_DONE_OK = 0;
 const TEL_CAPTURE_DONE_TIMEOUT = 1;
 // 2 and 3 were used when we had special handling for private-browsing.
 const TEL_CAPTURE_DONE_CRASHED = 4;
 const TEL_CAPTURE_DONE_BAD_URI = 5;
 
--- a/toolkit/components/thumbnails/PageThumbUtils.jsm
+++ b/toolkit/components/thumbnails/PageThumbUtils.jsm
@@ -7,19 +7,19 @@
  * PageThumbs and backgroundPageThumbsContent.
  */
 
 this.EXPORTED_SYMBOLS = ["PageThumbUtils"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 
 this.PageThumbUtils = {
   // The default background color for page thumbnails.
   THUMBNAIL_BG_COLOR: "#fff",
   // The namespace for thumbnail canvas elements.
--- a/toolkit/components/thumbnails/PageThumbsProtocol.js
+++ b/toolkit/components/thumbnails/PageThumbsProtocol.js
@@ -18,18 +18,18 @@
 
 "use strict";
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/PageThumbs.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { PageThumbs, PageThumbsStorage } = Cu.import("resource://gre/modules/PageThumbs.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/osfile.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
   "resource://gre/modules/FileUtils.jsm");
 
 const SUBSTITUTING_URL_CID = "{dea9657c-18cf-4984-bde9-ccef5d8ab473}";
--- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
+++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.importGlobalProperties(['Blob', 'FileReader']);
 
-Cu.import("resource://gre/modules/PageThumbUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { PageThumbUtils } = Cu.import("resource://gre/modules/PageThumbUtils.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const STATE_LOADING = 1;
 const STATE_CAPTURING = 2;
 const STATE_CANCELED = 3;
 
 // NOTE: Copied from nsSandboxFlags.h
 /**
  * This flag prevents content from creating new auxiliary browsing contexts,
--- a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
+++ b/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
@@ -1,17 +1,17 @@
 // tests to check that moz-page-thumb URLs correctly resolve as file:// URLS
 "use strict";
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // need profile so that PageThumbsStorage can resolve the path to the underlying file
 do_get_profile();
 
 function run_test() {
   // first check the protocol handler implements the correct interface
   let handler = Services.io.getProtocolHandler("moz-page-thumb");
   ok(handler instanceof Ci.nsISubstitutingProtocolHandler,
--- a/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js
+++ b/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var Cu = Components.utils;
 
-// Ideally we would use CrashTestUtils.jsm, but that's only available for
-// xpcshell tests - so we just copy a ctypes crasher from it.
-Cu.import("resource://gre/modules/ctypes.jsm");
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
 var crash = function() { // this will crash when called.
   let zero = new ctypes.intptr_t(8);
   let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
   badptr.contents
 };
 
 
 var TestHelper = {
--- a/toolkit/components/timermanager/tests/unit/consumerNotifications.js
+++ b/toolkit/components/timermanager/tests/unit/consumerNotifications.js
@@ -5,17 +5,17 @@
 
 /* General Update Timer Manager Tests */
 
 'use strict';
 
 const { classes: Cc, interfaces: Ci, manager: Cm, results: Cr,
         utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const CATEGORY_UPDATE_TIMER = "update-timer";
 
 const PREF_APP_UPDATE_TIMERMINIMUMDELAY = "app.update.timerMinimumDelay";
 const PREF_APP_UPDATE_TIMERFIRSTINTERVAL = "app.update.timerFirstInterval";
 const PREF_APP_UPDATE_LOG_ALL = "app.update.log.all";
 const PREF_BRANCH_LAST_UPDATE_TIME = "app.update.lastUpdateTime.";
 
--- a/toolkit/components/tooltiptext/TooltipTextProvider.js
+++ b/toolkit/components/tooltiptext/TooltipTextProvider.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function TooltipTextProvider() {}
 
 TooltipTextProvider.prototype = {
   getNodeText(tipElement, textOut, directionOut) {
     // Don't show the tooltip if the tooltip node is a document, browser, or disconnected.
     if (!tipElement || !tipElement.ownerDocument ||
         tipElement.localName == "browser" ||
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["SafeBrowsing"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // Log only if browser.safebrowsing.debug is true
 function log(...stuff) {
   let logging = null;
   try {
     logging = Services.prefs.getBoolPref("browser.safebrowsing.debug");
   } catch(e) {
     return;
--- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
@@ -8,19 +8,19 @@ const Cr = Components.results;
 const Cu = Components.utils;
 
 // COMPLETE_LENGTH and PARTIAL_LENGTH copied from nsUrlClassifierDBService.h,
 // they correspond to the length, in bytes, of a hash prefix and the total
 // hash.
 const COMPLETE_LENGTH = 32;
 const PARTIAL_LENGTH = 4;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 
 // Log only if browser.safebrowsing.debug is true
 function log(...stuff) {
   let logging = null;
   try {
     logging = Services.prefs.getBoolPref("browser.safebrowsing.debug");
   } catch(e) {
--- a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
+++ b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
@@ -4,17 +4,17 @@ this.EXPORTED_SYMBOLS = ["UrlClassifierT
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const TRACKING_TABLE_NAME = "mochitest-track-simple";
 const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
 const WHITELIST_TABLE_NAME = "mochitest-trackwhite-simple";
 const WHITELIST_TABLE_PREF = "urlclassifier.trackingWhitelistTable";
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 this.UrlClassifierTestUtils = {
 
   addTestTrackers() {
     // Add some URLs to the tracking databases
     let trackingURL1 = "tracking.example.com/";
     let trackingURL2 = "itisatracker.org/";
     let trackingURL3 = "trackertest.org/";
--- a/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
+++ b/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
@@ -1,11 +1,11 @@
-Cu.import("resource://gre/modules/SafeBrowsing.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/AppInfo.jsm");
+let { SafeBrowsing } = Cu.import("resource://gre/modules/SafeBrowsing.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { updateAppInfo } = Cu.import("resource://testing-common/AppInfo.jsm", {});
 
 // 'Cc["@mozilla.org/xre/app-info;1"]' for xpcshell has no nsIXULAppInfo
 // so that we have to update it to make nsURLFormatter.js happy.
 // (SafeBrowsing.init() will indirectly use nsURLFormatter.js)
 updateAppInfo();
 
 function run_test() {
   SafeBrowsing.init();
--- a/toolkit/components/url-classifier/tests/unit/test_digest256.js
+++ b/toolkit/components/url-classifier/tests/unit/test_digest256.js
@@ -1,9 +1,9 @@
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 // Global test server for serving safebrowsing updates.
 var gHttpServ = null;
 // Global nsIUrlClassifierDBService
--- a/toolkit/components/url-classifier/tests/unit/test_listmanager.js
+++ b/toolkit/components/url-classifier/tests/unit/test_listmanager.js
@@ -1,9 +1,9 @@
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 
 // These tables share the same updateURL.
 const TEST_TABLE_DATA_LIST = [
   // 0:
--- a/toolkit/components/url-classifier/tests/unit/test_provider_url.js
+++ b/toolkit/components/url-classifier/tests/unit/test_provider_url.js
@@ -1,10 +1,10 @@
 Cu.import("resource://testing-common/AppInfo.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function updateVersion(version) {
   updateAppInfo({ version });
 }
 
 add_test(function test_provider_url() {
   let urls = [
     "browser.safebrowsing.provider.google.updateURL",
--- a/toolkit/components/utils/simpleServices.js
+++ b/toolkit/components/utils/simpleServices.js
@@ -12,17 +12,17 @@
 
 "use strict";
 
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 function AddonPolicyService()
 {
--- a/toolkit/components/viewsource/ViewSourceBrowser.jsm
+++ b/toolkit/components/viewsource/ViewSourceBrowser.jsm
@@ -1,17 +1,17 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
   "resource://gre/modules/Deprecated.jsm");
 
 const BUNDLE_URL = "chrome://global/locale/viewSource.properties";
 
--- a/toolkit/components/viewsource/content/viewSource-content.js
+++ b/toolkit/components/viewsource/content/viewSource-content.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { utils: Cu, interfaces: Ci, classes: Cc } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
   "resource://gre/modules/DeferredTask.jsm");
 
 const NS_XHTML = "http://www.w3.org/1999/xhtml";
 const BUNDLE_URL = "chrome://global/locale/viewSource.properties";
--- a/toolkit/components/viewsource/content/viewSource.js
+++ b/toolkit/components/viewsource/content/viewSource.js
@@ -1,18 +1,18 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { utils: Cu, interfaces: Ci, classes: Cc } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ViewSourceBrowser.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { ViewSourceBrowser } = Cu.import("resource://gre/modules/ViewSourceBrowser.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
   "resource://gre/modules/CharsetMenu.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
   "resource://gre/modules/Deprecated.jsm");
 
--- a/toolkit/components/viewsource/test/browser/head.js
+++ b/toolkit/components/viewsource/test/browser/head.js
@@ -1,14 +1,10 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 const WINDOW_TYPE = "navigator:view-source";
 
 function openViewSourceWindow(aURI, aCallback) {
   let viewSourceWindow = openDialog("chrome://global/content/viewSource.xul", null, null, aURI);
   viewSourceWindow.addEventListener("pageshow", function pageShowHandler(event) {
     // Wait for the inner window to load, not viewSourceWindow.
     if (event.target.location == "view-source:" + aURI) {
--- a/toolkit/components/xulstore/XULStore.js
+++ b/toolkit/components/xulstore/XULStore.js
@@ -13,19 +13,19 @@ const debugMode = false;
 // Delay when a change is made to when the file is saved.
 // 30 seconds normally, or 3 seconds for testing
 const WRITE_DELAY_MS = (debugMode ? 3 : 30) * 1000;
 
 const XULSTORE_CONTRACTID = "@mozilla.org/xul/xulstore;1";
 const XULSTORE_CID = Components.ID("{6f46b6f4-c8b1-4bd4-a4fa-9ebbed0753ea}");
 const STOREDB_FILENAME = "xulstore.json";
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 
 function XULStore() {
   if (!Services.appinfo.inSafeMode)
     this.load();
 }
--- a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
+++ b/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
@@ -4,17 +4,17 @@
 
 "use strict"
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/osfile.jsm")
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 var XULStore = null;
 var browserURI = "chrome://browser/content/browser.xul";
 var aboutURI = "about:config";
 
 function run_test() {
   do_get_profile();
   run_next_test();
--- a/toolkit/content/aboutNetworking.js
+++ b/toolkit/content/aboutNetworking.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 const FileUtils = Cu.import("resource://gre/modules/FileUtils.jsm").FileUtils
 const gEnv = Cc["@mozilla.org/process/environment;1"]
                .getService(Ci.nsIEnvironment);
 const gDashboard = Cc['@mozilla.org/network/dashboard;1']
                      .getService(Ci.nsIDashboard);
 const gDirServ = Cc["@mozilla.org/file/directory_service;1"]
                    .getService(Ci.nsIDirectoryServiceProvider);
 
--- a/toolkit/content/aboutProfiles.js
+++ b/toolkit/content/aboutProfiles.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/AppConstants.jsm');
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { AppConstants } = Cu.import('resource://gre/modules/AppConstants.jsm', {});
 
 XPCOMUtils.defineLazyServiceGetter(
   this,
   'ProfileService',
   '@mozilla.org/toolkit/profile-service;1',
   'nsIToolkitProfileService'
 );
 
--- a/toolkit/content/aboutServiceWorkers.js
+++ b/toolkit/content/aboutServiceWorkers.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
 
 const bundle = Services.strings.createBundle(
   "chrome://global/locale/aboutServiceWorkers.properties");
 
 const brandBundle = Services.strings.createBundle(
   "chrome://branding/locale/brand.properties");
 
 var gSWM;
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Troubleshoot.jsm");
-Cu.import("resource://gre/modules/ResetProfile.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Troubleshoot } = Cu.import("resource://gre/modules/Troubleshoot.jsm", {});
+let { ResetProfile } = Cu.import("resource://gre/modules/ResetProfile.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesDBUtils",
                                   "resource://gre/modules/PlacesDBUtils.jsm");
 
 window.addEventListener("load", function onload(event) {
   try {
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -3,26 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/TelemetryTimestamps.jsm");
-Cu.import("resource://gre/modules/TelemetryController.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { TelemetryTimestamps } = Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", {});
+let { TelemetryController } = Cu.import("resource://gre/modules/TelemetryController.jsm", {});
 Cu.import("resource://gre/modules/TelemetrySession.jsm");
-Cu.import("resource://gre/modules/TelemetryArchive.jsm");
-Cu.import("resource://gre/modules/TelemetryUtils.jsm");
+let { TelemetryArchive } = Cu.import("resource://gre/modules/TelemetryArchive.jsm", {});
+let { TelemetryUtils } = Cu.import("resource://gre/modules/TelemetryUtils.jsm", {});
 Cu.import("resource://gre/modules/TelemetryLog.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 
 const Telemetry = Services.telemetry;
 const bundle = Services.strings.createBundle(
   "chrome://global/locale/aboutTelemetry.properties");
 const brandBundle = Services.strings.createBundle(
--- a/toolkit/content/aboutwebrtc/aboutWebrtc.js
+++ b/toolkit/content/aboutwebrtc/aboutWebrtc.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /* global WebrtcGlobalInformation, document */
 
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "FilePicker",
                                    "@mozilla.org/filepicker;1", "nsIFilePicker");
 XPCOMUtils.defineLazyGetter(this, "strings", () => {
   return Services.strings.createBundle("chrome://global/locale/aboutWebrtc.properties");
 });
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -2,21 +2,21 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import("resource://gre/modules/RemoteAddonsChild.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { BrowserUtils } = Cu.import("resource://gre/modules/BrowserUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {});
+let { RemoteAddonsChild } = Cu.import("resource://gre/modules/RemoteAddonsChild.jsm", {});
 Cu.import("resource://gre/modules/Timer.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PageThumbUtils",
   "resource://gre/modules/PageThumbUtils.jsm");
 
 if (AppConstants.MOZ_CRASHREPORTER) {
   XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter",
                                      "@mozilla.org/xre/app-info;1",
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -3,18 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
   "resource://gre/modules/ReaderMode.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 
 var global = this;
 
--- a/toolkit/content/process-content.js
+++ b/toolkit/content/process-content.js
@@ -5,17 +5,17 @@
 "use strict";
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 // Creates a new PageListener for this process. This will listen for page loads
 // and for those that match URLs provided by the parent process will set up
 // a dedicated message port and notify the parent process.
 Cu.import("resource://gre/modules/RemotePageManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
 
 Services.cpmm.addMessageListener("gmp-plugin-crash", msg => {
   let gmpservice = Cc["@mozilla.org/gecko-media-plugin-service;1"]
                      .getService(Ci.mozIGeckoMediaPluginService);
 
   gmpservice.RunPluginCrashCallbacks(msg.data.pluginID, msg.data.pluginName);
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ b/toolkit/crashreporter/CrashSubmit.jsm
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/KeyValueParser.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { parseKeyValuePairs, parseKeyValuePairsFromFile } = Cu.import("resource://gre/modules/KeyValueParser.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.importGlobalProperties(['File']);
 
 XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
                                   "resource://gre/modules/PromiseUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
--- a/toolkit/crashreporter/content/crashes.js
+++ b/toolkit/crashreporter/content/crashes.js
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, utils: Cu, interfaces: Ci } = Components;
 
 var reportURL;
 
-Cu.import("resource://gre/modules/CrashReports.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { CrashReports } = Cu.import("resource://gre/modules/CrashReports.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
   "resource://gre/modules/CrashSubmit.jsm");
 
 const buildID = Services.appinfo.appBuildID;
 
 function submitPendingReport(event) {
   let link = event.target;
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
@@ -1,26 +1,12 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 sts=2
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test added with bug 460086 to test the behavior of the new API that was added
- * to remove all traces of visiting a site.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-//// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PlacesUtils } = Cu.import("resource://gre/modules/PlacesUtils.jsm", {});
+let { ForgetAboutSite } = Cu.import("resource://gre/modules/ForgetAboutSite.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
                                   "resource://testing-common/PlacesTestUtils.jsm");
 
 const COOKIE_EXPIRY = Math.round(Date.now() / 1000) + 60;
 const COOKIE_NAME = "testcookie";
--- a/toolkit/identity/Identity.jsm
+++ b/toolkit/identity/Identity.jsm
@@ -8,22 +8,22 @@
 
 this.EXPORTED_SYMBOLS = ["IdentityService"];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/IdentityStore.jsm");
-Cu.import("resource://gre/modules/identity/RelyingParty.jsm");
-Cu.import("resource://gre/modules/identity/IdentityProvider.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
+let { IdentityStore } = Cu.import("resource://gre/modules/identity/IdentityStore.jsm", {});
+let { RelyingParty } = Cu.import("resource://gre/modules/identity/RelyingParty.jsm", {});
+let { IdentityProvider } = Cu.import("resource://gre/modules/identity/IdentityProvider.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this,
                                   "jwcrypto",
                                   "resource://gre/modules/identity/jwcrypto.jsm");
 
 function log(...aMessageArgs) {
   Logger.log.apply(Logger, ["core"].concat(aMessageArgs));
 }
--- a/toolkit/identity/IdentityProvider.jsm
+++ b/toolkit/identity/IdentityProvider.jsm
@@ -6,20 +6,20 @@
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/Sandbox.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
+let { Sandbox } = Cu.import("resource://gre/modules/identity/Sandbox.jsm", {});
 
 this.EXPORTED_SYMBOLS = ["IdentityProvider"];
 const FALLBACK_PROVIDER = "browserid.org";
 
 XPCOMUtils.defineLazyModuleGetter(this,
                                   "jwcrypto",
                                   "resource://gre/modules/identity/jwcrypto.jsm");
 
--- a/toolkit/identity/IdentityStore.jsm
+++ b/toolkit/identity/IdentityStore.jsm
@@ -6,18 +6,18 @@
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 this.EXPORTED_SYMBOLS = ["IdentityStore"];
 
 // the data store for IDService
 // written as a separate thing so it can easily be mocked
 function IDServiceStore() {
   this.reset();
 }
--- a/toolkit/identity/IdentityUtils.jsm
+++ b/toolkit/identity/IdentityUtils.jsm
@@ -13,17 +13,17 @@ this.EXPORTED_SYMBOLS = [
   "checkRenamed",
   "getRandomId",
   "objectCopy",
   "makeMessageObject",
 ];
 
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Logger",
                                   "resource://gre/modules/identity/LogUtils.jsm");
 
--- a/toolkit/identity/LogUtils.jsm
+++ b/toolkit/identity/LogUtils.jsm
@@ -9,18 +9,18 @@
 this.EXPORTED_SYMBOLS = ["Logger"];
 const PREF_DEBUG = "toolkit.identity.debug";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function IdentityLogger() {
   Services.prefs.addObserver(PREF_DEBUG, this, false);
   this._debug = Services.prefs.getBoolPref(PREF_DEBUG);
   return this;
 }
 
 IdentityLogger.prototype = {
--- a/toolkit/identity/MinimalIdentity.jsm
+++ b/toolkit/identity/MinimalIdentity.jsm
@@ -17,19 +17,19 @@
 
 this.EXPORTED_SYMBOLS = ["IdentityService"];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "makeMessageObject",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 
 function log(...aMessageArgs) {
--- a/toolkit/identity/RelyingParty.jsm
+++ b/toolkit/identity/RelyingParty.jsm
@@ -6,20 +6,20 @@
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/IdentityStore.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
+let { IdentityStore } = Cu.import("resource://gre/modules/identity/IdentityStore.jsm", {});
 
 this.EXPORTED_SYMBOLS = ["RelyingParty"];
 
 XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this,
                                   "jwcrypto",
--- a/toolkit/identity/Sandbox.jsm
+++ b/toolkit/identity/Sandbox.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Sandbox"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const XHTML_NS = "http://www.w3.org/1999/xhtml";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this,
                                   "Logger",
                                   "resource://gre/modules/identity/LogUtils.jsm");
 
 /**
  * An object that represents a sandbox in an iframe loaded with aURL. The
  * callback provided to the constructor will be invoked when the sandbox is
--- a/toolkit/identity/jwcrypto.jsm
+++ b/toolkit/identity/jwcrypto.jsm
@@ -7,19 +7,19 @@
 "use strict";
 
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
 
 XPCOMUtils.defineLazyServiceGetter(this,
                                    "IdentityCryptoService",
                                    "@mozilla.org/identity/crypto-service;1",
                                    "nsIIdentityCryptoService");
 
 this.EXPORTED_SYMBOLS = ["jwcrypto"];
 
--- a/toolkit/identity/tests/unit/head_identity.js
+++ b/toolkit/identity/tests/unit/head_identity.js
@@ -6,21 +6,18 @@ var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 Cu.import("resource://testing-common/httpd.js");
 
 // XXX until bug 937114 is fixed
 Cu.importGlobalProperties(["atob"]);
 
-// The following boilerplate makes sure that XPCOM calls
-// that use the profile directory work.
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
                                   "resource://gre/modules/identity/jwcrypto.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "IDService",
                                   "resource://gre/modules/identity/Identity.jsm",
                                   "IdentityService");
 
--- a/toolkit/identity/tests/unit/test_firefox_accounts.js
+++ b/toolkit/identity/tests/unit/test_firefox_accounts.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/DOMIdentity.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { DOMIdentity } = Cu.import("resource://gre/modules/DOMIdentity.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FirefoxAccounts",
                                   "resource://gre/modules/identity/FirefoxAccounts.jsm");
 
 // Make the profile dir available; this is necessary so that
 // services/fxaccounts/FxAccounts.jsm can read and write its signed-in user
 // data.
 do_get_profile();
--- a/toolkit/identity/tests/unit/test_identity_utils.js
+++ b/toolkit/identity/tests/unit/test_identity_utils.js
@@ -1,14 +1,14 @@
 
 "use strict";
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/identity/IdentityUtils.jsm');
+let { checkDeprecated, checkRenamed } = Cu.import('resource://gre/modules/identity/IdentityUtils.jsm', {});
 
 function test_check_deprecated() {
   let options = {
     id: 123,
     loggedInEmail: "jed@foo.com",
     pies: 42
   };
 
--- a/toolkit/identity/tests/unit/test_log_utils.js
+++ b/toolkit/identity/tests/unit/test_log_utils.js
@@ -1,14 +1,14 @@
 
 "use strict";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/identity/LogUtils.jsm');
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import('resource://gre/modules/Services.jsm', {});
+let { Logger } = Cu.import('resource://gre/modules/identity/LogUtils.jsm', {});
 
 function toggle_debug() {
   do_test_pending();
 
   function Wrapper() {
     this.init();
   }
   Wrapper.prototype = {
--- a/toolkit/identity/tests/unit/test_minimalidentity.js
+++ b/toolkit/identity/tests/unit/test_minimalidentity.js
@@ -2,18 +2,18 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 XPCOMUtils.defineLazyModuleGetter(this, "MinimalIDService",
                                   "resource://gre/modules/identity/MinimalIdentity.jsm",
                                   "IdentityService");
 
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/DOMIdentity.jsm");
+let { Logger } = Cu.import("resource://gre/modules/identity/LogUtils.jsm", {});
+let { DOMIdentity } = Cu.import("resource://gre/modules/DOMIdentity.jsm", {});
 
 function log(...aMessageArgs) {
   Logger.log.apply(Logger, ["test_minimalidentity"].concat(aMessageArgs));
 }
 
 function test_overall() {
   do_check_neq(MinimalIDService, null);
   run_next_test();
--- a/toolkit/identity/tests/unit/test_provisioning.js
+++ b/toolkit/identity/tests/unit/test_provisioning.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-Cu.import("resource://gre/modules/identity/IdentityProvider.jsm");
+let { IdentityProvider } = Cu.import("resource://gre/modules/identity/IdentityProvider.jsm", {});
 
 function check_provision_flow_done(provId) {
   do_check_null(IdentityProvider._provisionFlows[provId]);
 }
 
 function test_begin_provisioning() {
   do_test_pending();
 
--- a/toolkit/identity/tests/unit/test_well-known.js
+++ b/toolkit/identity/tests/unit/test_well-known.js
@@ -1,12 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "IDService",
                                   "resource://gre/modules/identity/Identity.jsm",
                                   "IdentityService");
 
 const WELL_KNOWN_PATH = "/.well-known/browserid";
 
--- a/toolkit/modules/AsyncPrefs.jsm
+++ b/toolkit/modules/AsyncPrefs.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["AsyncPrefs"];
 
 const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 const kInChildProcess = Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
 
 const kAllowedPrefs = new Set([
   // NB: please leave the testing prefs at the top, and sort the rest alphabetically if you add
   // anything.
   "testing.allowed-prefs.some-bool-pref",
   "testing.allowed-prefs.some-char-pref",
--- a/toolkit/modules/BrowserUtils.jsm
+++ b/toolkit/modules/BrowserUtils.jsm
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "BrowserUtils" ];
 
 const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.importGlobalProperties(['URL']);
 
 this.BrowserUtils = {
 
   /**
    * Prints arguments separated by a space and appends a new line.
    */
   dumpLn: function (...args) {
--- a/toolkit/modules/CanonicalJSON.jsm
+++ b/toolkit/modules/CanonicalJSON.jsm
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["CanonicalJSON"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "jsesc",
                                   "resource://gre/modules/third_party/jsesc/jsesc.js");
 
 this.CanonicalJSON = {
   /**
    * Return the canonical JSON form of the passed source, sorting all the object
    * keys recursively. Note that this method will cause an infinite loop if
    * cycles exist in the source (bug 1265357).
--- a/toolkit/modules/CharsetMenu.jsm
+++ b/toolkit/modules/CharsetMenu.jsm
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = [ "CharsetMenu" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyGetter(this, "gBundle", function() {
   const kUrl = "chrome://global/locale/charsetMenu.properties";
   return Services.strings.createBundle(kUrl);
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
     "resource://gre/modules/Deprecated.jsm");
 
--- a/toolkit/modules/ClientID.jsm
+++ b/toolkit/modules/ClientID.jsm
@@ -3,21 +3,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ClientID"];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 
 const LOGGER_NAME = "Toolkit.Telemetry";
 const LOGGER_PREFIX = "ClientID::";
 
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 
 XPCOMUtils.defineLazyGetter(this, "gDatareportingPath", () => {
--- a/toolkit/modules/Console.jsm
+++ b/toolkit/modules/Console.jsm
@@ -19,17 +19,17 @@
  * - The primary use of this API is debugging and error logging so the perfect
  *   implementation isn't always required (or even well defined)
  */
 
 this.EXPORTED_SYMBOLS = [ "console", "ConsoleAPI" ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 var gTimerRegistry = new Map();
 
 /**
  * String utility to ensure that strings are a specified length. Strings
--- a/toolkit/modules/DateTimePickerHelper.jsm
+++ b/toolkit/modules/DateTimePickerHelper.jsm
@@ -15,17 +15,17 @@ function debug(aStr) {
   }
 }
 
 this.EXPORTED_SYMBOLS = [
   "DateTimePickerHelper"
 ];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 /*
  * DateTimePickerHelper receives message from content side (input box) and
  * is reposible for opening, closing and updating the picker. Similary,
  * DateTimePickerHelper listens for picker's events and notifies the content
  * side (input box) about them.
  */
 this.DateTimePickerHelper = {
--- a/toolkit/modules/DeferredTask.jsm
+++ b/toolkit/modules/DeferredTask.jsm
@@ -82,17 +82,17 @@ this.EXPORTED_SYMBOLS = [
  *                              .then(null, Components.utils.reportError);
  */
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 const Timer = Components.Constructor("@mozilla.org/timer;1", "nsITimer",
                                      "initWithCallback");
--- a/toolkit/modules/Deprecated.jsm
+++ b/toolkit/modules/Deprecated.jsm
@@ -5,17 +5,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "Deprecated" ];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const PREF_DEPRECATION_WARNINGS = "devtools.errorconsole.deprecation_warnings";
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // A flag that indicates whether deprecation warnings should be logged.
 var logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS);
 
 Services.prefs.addObserver(PREF_DEPRECATION_WARNINGS,
   function (aSubject, aTopic, aData) {
     logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS);
   }, false);
--- a/toolkit/modules/Finder.jsm
+++ b/toolkit/modules/Finder.jsm
@@ -2,20 +2,20 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["Finder", "GetClipboardSearchString"];
 
 const { interfaces: Ci, classes: Cc, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Geometry.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Rect } = Cu.import("resource://gre/modules/Geometry.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "TextToSubURIService",
                                          "@mozilla.org/intl/texttosuburi;1",
                                          "nsITextToSubURI");
 XPCOMUtils.defineLazyServiceGetter(this, "Clipboard",
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -3,19 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["FinderHighlighter"];
 
 const { interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Color", "resource://gre/modules/Color.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
 XPCOMUtils.defineLazyGetter(this, "kDebug", () => {
   const kDebugPref = "findbar.modalHighlight.debug";
   return Services.prefs.getPrefType(kDebugPref) && Services.prefs.getBoolPref(kDebugPref);
 });
 
--- a/toolkit/modules/FinderIterator.jsm
+++ b/toolkit/modules/FinderIterator.jsm
@@ -3,20 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["FinderIterator"];
 
 const { interfaces: Ci, classes: Cc, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NLP", "resource://gre/modules/NLP.jsm");
 
 const kDebug = false;
 const kIterationSizeMax = 100;
 const kTimeoutPref = "findbar.iteratorTimeout";
 
 /**
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -13,26 +13,26 @@ const DEFAULT_SECONDS_BETWEEN_CHECKS = 6
 
 var GMPInstallFailureReason = {
   GMP_INVALID: 1,
   GMP_HIDDEN: 2,
   GMP_DISABLED: 3,
   GMP_UPDATE_DISABLED: 4,
 };
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/GMPUtils.jsm");
-Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { GMP_PLUGIN_IDS, GMPPrefs, GMPUtils } = Cu.import("resource://gre/modules/GMPUtils.jsm", {});
+let { ProductAddonChecker } = Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm", {});
 
 this.EXPORTED_SYMBOLS = ["GMPInstallManager", "GMPExtractor", "GMPDownloader",
                          "GMPAddon"];
 
 // Shared code for suppressing bad cert dialogs
 XPCOMUtils.defineLazyGetter(this, "gCertUtils", function() {
   let temp = { };
   Cu.import("resource://gre/modules/CertUtils.jsm", temp);
--- a/toolkit/modules/GMPUtils.jsm
+++ b/toolkit/modules/GMPUtils.jsm
@@ -9,19 +9,19 @@ const {classes: Cc, interfaces: Ci, resu
 
 this.EXPORTED_SYMBOLS = [ "EME_ADOBE_ID",
                           "GMP_PLUGIN_IDS",
                           "GMPPrefs",
                           "GMPUtils",
                           "OPEN_H264_ID",
                           "WIDEVINE_ID" ];
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 // GMP IDs
 const OPEN_H264_ID  = "gmp-gmpopenh264";
 const EME_ADOBE_ID  = "gmp-eme-adobe";
 const WIDEVINE_ID   = "gmp-widevinecdm";
 const GMP_PLUGIN_IDS = [ OPEN_H264_ID, EME_ADOBE_ID, WIDEVINE_ID ];
 
 var GMPPluginUnsupportedReason = {
--- a/toolkit/modules/Integration.jsm
+++ b/toolkit/modules/Integration.jsm
@@ -107,17 +107,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "Integration",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 /**
  * Maps integration point names to IntegrationPoint objects.
  */
 const gIntegrationPoints = new Map();
 
 /**
  * This Proxy object creates IntegrationPoint objects using their name as key.
--- a/toolkit/modules/JSONFile.jsm
+++ b/toolkit/modules/JSONFile.jsm
@@ -32,18 +32,18 @@ this.EXPORTED_SYMBOLS = [
   "JSONFile",
 ];
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
   "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 this.LightweightThemeConsumer =
--- a/toolkit/modules/Locale.jsm
+++ b/toolkit/modules/Locale.jsm
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["Locale"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 const PREF_MATCH_OS_LOCALE            = "intl.locale.matchOS";
 const PREF_SELECTED_LOCALE            = "general.useragent.locale";
 
 this.Locale = {
   /**
    * Gets the currently selected locale for display.
    * @return  the selected locale or "en-US" if none is selected
--- a/toolkit/modules/Log.jsm
+++ b/toolkit/modules/Log.jsm
@@ -10,17 +10,17 @@ const {classes: Cc, interfaces: Ci, resu
 
 const ONE_BYTE = 1;
 const ONE_KILOBYTE = 1024 * ONE_BYTE;
 const ONE_MEGABYTE = 1024 * ONE_KILOBYTE;
 
 const STREAM_SEGMENT_SIZE = 4096;
 const PR_UINT32_MAX = 0xffffffff;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 const INTERNAL_FIELDS = new Set(["_level", "_message", "_time", "_namespace"]);
 
 
 /*
--- a/toolkit/modules/Memory.jsm
+++ b/toolkit/modules/Memory.jsm
@@ -3,18 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["Memory"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 // How long we should wait for the Promise to resolve.
 const TIMEOUT_INTERVAL = 2000;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { setTimeout, clearTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 this.Memory = {
   /**
    * This function returns a Promise that resolves with an Object that
    * describes basic memory usage for each content process and the parent
    * process.
    * @returns Promise
    * @resolves JS Object
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["NewTabUtils"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
   "resource://gre/modules/PageThumbs.jsm");
 
--- a/toolkit/modules/PageMetadata.jsm
+++ b/toolkit/modules/PageMetadata.jsm
@@ -3,19 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PageMetadata"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/microformat-shiv.js");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Microformats } = Cu.import("resource://gre/modules/microformat-shiv.js", {});
 
 XPCOMUtils.defineLazyServiceGetter(this, "UnescapeService",
                                    "@mozilla.org/feed-unescapehtml;1",
                                    "nsIScriptableUnescapeHTML");
 
 
 /**
  * Maximum number of images to discover in the document, when no preview images
--- a/toolkit/modules/PermissionsUtils.jsm
+++ b/toolkit/modules/PermissionsUtils.jsm
@@ -1,17 +1,17 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["PermissionsUtils"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/BrowserUtils.jsm")
 
 
 var gImportedPrefBranches = new Set();
 
 function importPrefBranch(aPrefBranch, aPermission, aAction) {
   let list = Services.prefs.getChildList(aPrefBranch, {});
 
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["PopupNotifications"];
 
 var Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { PrivateBrowsingUtils } = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 const NOTIFICATION_EVENT_DISMISSED = "dismissed";
 const NOTIFICATION_EVENT_REMOVED = "removed";
 const NOTIFICATION_EVENT_SHOWING = "showing";
 const NOTIFICATION_EVENT_SHOWN = "shown";
 const NOTIFICATION_EVENT_SWAPPING = "swapping";
 
 const ICON_SELECTOR = ".notification-anchor-icon";
--- a/toolkit/modules/Preferences.jsm
+++ b/toolkit/modules/Preferences.jsm
@@ -4,18 +4,18 @@
 
 this.EXPORTED_SYMBOLS = ["Preferences"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 // The minimum and maximum integers that can be set as preferences.
 // The range of valid values is narrower than the range of valid JS values
 // because the native preferences code treats integers as NSPR PRInt32s,
 // which are 32-bit signed integers on all platforms.
 const MAX_INT = 0x7FFFFFFF; // Math.pow(2, 31) - 1
 const MIN_INT = -0x80000000;
 
--- a/toolkit/modules/ProfileAge.jsm
+++ b/toolkit/modules/ProfileAge.jsm
@@ -3,18 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ProfileAge"];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/osfile.jsm")
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://services-common/utils.js");
 
 /**
  * Profile access to times.json (eg, creation/reset time).
  * This is separate from the provider to simplify testing and enable extraction
  * to a shared location in the future.
--- a/toolkit/modules/PropertyListUtils.jsm
+++ b/toolkit/modules/PropertyListUtils.jsm
@@ -57,17 +57,17 @@
 
 this.EXPORTED_SYMBOLS = ["PropertyListUtils"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.importGlobalProperties(['File', 'FileReader']);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 this.PropertyListUtils = Object.freeze({
   /**
--- a/toolkit/modules/RemoteController.jsm
+++ b/toolkit/modules/RemoteController.jsm
@@ -5,17 +5,17 @@
 
 this.EXPORTED_SYMBOLS = ["RemoteController"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 function RemoteController(browser)
 {
   this._browser = browser;
 
   // A map of commands that have had their enabled/disabled state assigned. The
   // value of each key will be true if enabled, and false if disabled.
   this._supportedCommands = { };
--- a/toolkit/modules/RemoteFinder.jsm
+++ b/toolkit/modules/RemoteFinder.jsm
@@ -3,18 +3,18 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["RemoteFinder", "RemoteFinderListener"];
 
 const { interfaces: Ci, classes: Cc, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Geometry.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Rect } = Cu.import("resource://gre/modules/Geometry.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "GetClipboardSearchString",
   () => Cu.import("resource://gre/modules/Finder.jsm", {}).GetClipboardSearchString
 );
 XPCOMUtils.defineLazyGetter(this, "Rect",
   () => Cu.import("resource://gre/modules/Geometry.jsm", {}).Rect
 );
 
--- a/toolkit/modules/RemotePageManager.jsm
+++ b/toolkit/modules/RemotePageManager.jsm
@@ -4,17 +4,17 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["RemotePages", "RemotePageManager", "PageListener"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function MessageListener() {
   this.listeners = new Map();
 }
 
 MessageListener.prototype = {
   keys: function() {
     return this.listeners.keys();
--- a/toolkit/modules/RemoteSecurityUI.jsm
+++ b/toolkit/modules/RemoteSecurityUI.jsm
@@ -4,17 +4,17 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["RemoteSecurityUI"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 function RemoteSecurityUI()
 {
     this._SSLStatus = null;
     this._state = 0;
 }
 
 RemoteSecurityUI.prototype = {
--- a/toolkit/modules/RemoteWebProgress.jsm
+++ b/toolkit/modules/RemoteWebProgress.jsm
@@ -4,17 +4,17 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 this.EXPORTED_SYMBOLS = ["RemoteWebProgressManager"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 function newURI(spec)
 {
     return Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
                                                     .newURI(spec, null, null);
 }
 
 function RemoteWebProgressRequest(spec, originalSpec, requestCPOW)
--- a/toolkit/modules/ResetProfile.jsm
+++ b/toolkit/modules/ResetProfile.jsm
@@ -3,18 +3,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ResetProfile"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const MOZ_APP_NAME = AppConstants.MOZ_APP_NAME;
 const MOZ_BUILD_APP = AppConstants.MOZ_BUILD_APP;
 
 this.ResetProfile = {
   /**
    * Check if reset is supported for the currently running profile.
    *
--- a/toolkit/modules/SelectContentHelper.jsm
+++ b/toolkit/modules/SelectContentHelper.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils",
                                    "@mozilla.org/inspector/dom-utils;1", "inIDOMUtils");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 
--- a/toolkit/modules/SessionRecorder.jsm
+++ b/toolkit/modules/SessionRecorder.jsm
@@ -5,19 +5,19 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "SessionRecorder",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 Cu.import("resource://services-common/utils.js");
 
 // We automatically prune sessions older than this.
 const MAX_SESSION_AGE_MS = 7 * 24 * 60 * 60 * 1000; // 7 days.
 const STARTUP_RETRY_INTERVAL_MS = 5000;
 
 // Wait up to 5 minutes for startup measurements before giving up.
 const MAX_STARTUP_TRIES = 300000 / STARTUP_RETRY_INTERVAL_MS;
--- a/toolkit/modules/ShortcutUtils.jsm
+++ b/toolkit/modules/ShortcutUtils.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["ShortcutUtils"];
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "PlatformKeys", function() {
   return Services.strings.createBundle(
     "chrome://global-platform/locale/platformKeys.properties");
 });
 
 XPCOMUtils.defineLazyGetter(this, "Keys", function() {
   return Services.strings.createBundle(
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -8,18 +8,18 @@ this.EXPORTED_SYMBOLS = [
   "Sqlite",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 // The time to wait before considering a transaction stuck and rejecting it.
 const TRANSACTIONS_QUEUE_TIMEOUT_MS = 240000 // 4 minutes
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Log",
--- a/toolkit/modules/Task.jsm
+++ b/toolkit/modules/Task.jsm
@@ -90,17 +90,17 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 // For now, we're worried about add-ons using Tasks with CPOWs, so we'll
 // permit them in this scope, but this support will go away soon.
 Cu.permitCPOWsInScope(this);
 
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 // The following error types are considered programmer errors, which should be
 // reported (possibly redundantly) so as to let programmers fix their code.
 const ERRORS_TO_REPORT = ["EvalError", "RangeError", "ReferenceError", "TypeError"];
 
 /**
  * The Task currently being executed
  */
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -3,19 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = [
   "Troubleshoot",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 var Experiments;
 try {
   Experiments = Cu.import("resource:///modules/experiments/Experiments.jsm").Experiments;
 }
 catch (e) {
 }
 
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["UpdateUtils"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/ctypes.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
 
 const FILE_UPDATE_LOCALE                  = "update.locale";
 const PREF_APP_DISTRIBUTION               = "distribution.id";
 const PREF_APP_DISTRIBUTION_VERSION       = "distribution.version";
 const PREF_APP_B2G_VERSION                = "b2g.version";
 const PREF_APP_UPDATE_CUSTOM              = "app.update.custom";
 const PREF_APP_UPDATE_IMEI_HASH           = "app.update.imei_hash";
 
--- a/toolkit/modules/WebChannel.jsm
+++ b/toolkit/modules/WebChannel.jsm
@@ -11,17 +11,17 @@ this.EXPORTED_SYMBOLS = ["WebChannel", "
 
 const ERRNO_UNKNOWN_ERROR              = 999;
 const ERROR_UNKNOWN                    = "UNKNOWN_ERROR";
 
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 
 /**
  * WebChannelBroker is a global object that helps manage WebChannel objects.
  * This object handles channel registration, origin validation and message multiplexing.
  */
 
 var WebChannelBroker = Object.create({
--- a/toolkit/modules/ZipUtils.jsm
+++ b/toolkit/modules/ZipUtils.jsm
@@ -4,18 +4,18 @@
 
 this.EXPORTED_SYMBOLS = [ "ZipUtils" ];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
--- a/toolkit/modules/addons/MatchPattern.jsm
+++ b/toolkit/modules/addons/MatchPattern.jsm
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
                                   "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
 
--- a/toolkit/modules/addons/WebNavigation.jsm
+++ b/toolkit/modules/addons/WebNavigation.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 const EXPORTED_SYMBOLS = ["WebNavigation"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
                                   "resource:///modules/RecentWindow.jsm");
 
 // Maximum amount of time that can be passed and still consider
 // the data recent (similar to how is done in nsNavHistory,
 // e.g. nsNavHistory::CheckIsRecentEvent, but with a lower threshold value).
 const RECENT_DATA_THRESHOLD = 5 * 1000000;
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -10,18 +10,18 @@ const EXPORTED_SYMBOLS = ["WebRequest"];
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const {nsIHttpActivityObserver, nsISocketTransport} = Ci;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebRequestCommon",
                                   "resource://gre/modules/WebRequestCommon.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebRequestUpload",
--- a/toolkit/modules/addons/WebRequestContent.js
+++ b/toolkit/modules/addons/WebRequestContent.js
@@ -4,18 +4,18 @@
 
 "use strict";
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
                                   "resource://gre/modules/MatchPattern.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebRequestCommon",
                                   "resource://gre/modules/WebRequestCommon.jsm");
 
 const IS_HTTP = /^https?:/;
 
--- a/toolkit/modules/addons/WebRequestUpload.jsm
+++ b/toolkit/modules/addons/WebRequestUpload.jsm
@@ -8,17 +8,17 @@ const EXPORTED_SYMBOLS = ["WebRequestUpl
 
 /* exported WebRequestUpload */
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 var WebRequestUpload;
 
 function rewind(stream) {
   try {
     stream.seek(0, 0);
   } catch (e) {
     // It might be already closed, e.g. because of a previous error.
--- a/toolkit/modules/secondscreen/PresentationApp.jsm
+++ b/toolkit/modules/secondscreen/PresentationApp.jsm
@@ -4,18 +4,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["PresentationApp"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "sysInfo", () => {
   return Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
 });
 
 const DEBUG = false;
 
 const STATE_UNINIT = "uninitialized" // RemoteMedia status
--- a/toolkit/modules/secondscreen/RokuApp.jsm
+++ b/toolkit/modules/secondscreen/RokuApp.jsm
@@ -4,18 +4,18 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["RokuApp"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 function log(msg) {
   //Services.console.logStringMessage(msg);
 }
 
 const PROTOCOL_VERSION = 1;
 
 /* RokuApp is a wrapper for interacting with a Roku channel.
--- a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
+++ b/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
@@ -4,19 +4,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["SimpleServiceDiscovery"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 var log = Cu.reportError;
 
 XPCOMUtils.defineLazyGetter(this, "converter", function () {
   let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
   conv.charset = "utf8";
   return conv;
 });
--- a/toolkit/modules/sessionstore/FormData.jsm
+++ b/toolkit/modules/sessionstore/FormData.jsm
@@ -4,17 +4,17 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["FormData"];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPathGenerator.jsm");
+let { XPathGenerator } = Cu.import("resource://gre/modules/XPathGenerator.jsm", {});
 
 /**
  * Returns whether the given URL very likely has input
  * fields that contain serialized session store data.
  */
 function isRestorationPage(url) {
   return url == "about:sessionrestore" || url == "about:welcomeback";
 }
--- a/toolkit/modules/subprocess/Subprocess.jsm
+++ b/toolkit/modules/subprocess/Subprocess.jsm
@@ -13,19 +13,19 @@
 "use strict";
 
 let EXPORTED_SYMBOLS = ["Subprocess"];
 
 /* exported Subprocess */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { SubprocessConstants } = Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm", {});
 
 if (AppConstants.platform == "win") {
   XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
                                     "resource://gre/modules/subprocess/subprocess_win.jsm");
 } else {
   XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
                                     "resource://gre/modules/subprocess/subprocess_unix.jsm");
 }
--- a/toolkit/modules/subprocess/subprocess_common.jsm
+++ b/toolkit/modules/subprocess/subprocess_common.jsm
@@ -6,18 +6,18 @@
 "use strict";
 
 /* eslint-disable mozilla/balanced-listeners */
 
 /* exported BaseProcess, PromiseWorker */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.importGlobalProperties(["TextDecoder"]);
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
                                   "resource://gre/modules/Timer.jsm");
 
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared.js", this);
--- a/toolkit/modules/subprocess/subprocess_unix.jsm
+++ b/toolkit/modules/subprocess/subprocess_unix.jsm
@@ -10,21 +10,21 @@
 /* exported SubprocessImpl */
 
 /* globals BaseProcess, PromiseWorker */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 var EXPORTED_SYMBOLS = ["SubprocessImpl"];
 
-Cu.import("resource://gre/modules/ctypes.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm");
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { BaseProcess, PromiseWorker, SubprocessConstants } = Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm", {});
 
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared.js", this);
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared_unix.js", this);
 
 class UnixPromiseWorker extends PromiseWorker {
   constructor(...args) {
     super(...args);
 
--- a/toolkit/modules/subprocess/subprocess_win.jsm
+++ b/toolkit/modules/subprocess/subprocess_win.jsm
@@ -10,22 +10,22 @@
 /* exported SubprocessImpl */
 
 /* globals BaseProcess, PromiseWorker */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 var EXPORTED_SYMBOLS = ["SubprocessImpl"];
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/ctypes.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { BaseProcess, PromiseWorker, SubprocessConstants } = Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm", {});
 
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared.js", this);
 Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared_win.js", this);
 
 class WinPromiseWorker extends PromiseWorker {
   constructor(...args) {
     super(...args);
 
--- a/toolkit/modules/subprocess/test/xpcshell/head.js
+++ b/toolkit/modules/subprocess/test/xpcshell/head.js
@@ -1,13 +1,13 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Subprocess",
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
+++ b/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
@@ -1,13 +1,13 @@
 "use strict";
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
 
 const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
 
 const MAX_ROUND_TRIP_TIME_MS = AppConstants.DEBUG || AppConstants.ASAN ? 18 : 9;
 const MAX_RETRIES = 5;
 
 let PYTHON;
--- a/toolkit/modules/tests/xpcshell/TestIntegration.jsm
+++ b/toolkit/modules/tests/xpcshell/TestIntegration.jsm
@@ -8,17 +8,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "TestIntegration",
 ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/Task.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 this.TestIntegration = {
   value: "value",
 
   get valueFromThis() {
     return this.value;
   },
 
--- a/toolkit/modules/tests/xpcshell/test_DeferredTask.js
+++ b/toolkit/modules/tests/xpcshell/test_DeferredTask.js
@@ -5,17 +5,17 @@
  * This file tests the DeferredTask.jsm module.
  */
 
 ////////////////////////////////////////////////////////////////////////////////
 /// Globals
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
 /**
  * Due to the nature of this module, most of the tests are time-dependent.  All
--- a/toolkit/modules/tests/xpcshell/test_FinderIterator.js
+++ b/toolkit/modules/tests/xpcshell/test_FinderIterator.js
@@ -1,11 +1,11 @@
 const { interfaces: Ci, classes: Cc, utils: Cu } = Components;
 const { FinderIterator } = Cu.import("resource://gre/modules/FinderIterator.jsm", {});
-Cu.import("resource://gre/modules/Promise.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 var gFindResults = [];
 // Stub the method that instantiates nsIFind and does all the interaction with
 // the docShell to be searched through.
 FinderIterator._iterateDocument = function* (word, window, finder) {
   for (let range of gFindResults)
     yield range;
 };
--- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
+++ b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components;
 const URL_HOST = "http://localhost";
 
 var GMPScope = Cu.import("resource://gre/modules/GMPInstallManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm")
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
 
 var { computeHash } = Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
 var ProductAddonCheckerScope = Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
 
 do_get_profile();
 
 function run_test() { Cu.import("resource://gre/modules/Preferences.jsm")
   Preferences.set("media.gmp.log.dump", true);
--- a/toolkit/modules/tests/xpcshell/test_Integration.js
+++ b/toolkit/modules/tests/xpcshell/test_Integration.js
@@ -102,17 +102,17 @@ function* assertCombinedResults(combined
   combined.property = "property";
   Assert.equal(combined.property, prefix.repeat(2) + "property");
 
   combined.methodArgument = "";
   Assert.equal(combined.method("-argument"), prefix + "method-argument");
   Assert.equal(combined.methodArgument, "-argument");
 
   combined.asyncMethodArgument = "";
-  Assert.equal(yield combined.asyncMethod("-argument"),
+  Assert.equal((yield combined.asyncMethod("-argument")),
                prefix + "asyncMethod-argument");
   Assert.equal(combined.asyncMethodArgument, "-argument");
 }
 
 /**
  * Fails the test if the results of method invocations on the combined object
  * for the "testModule" integration point don't match the expected results based
  * on how many overrides are registered.
--- a/toolkit/modules/tests/xpcshell/test_JSONFile.js
+++ b/toolkit/modules/tests/xpcshell/test_JSONFile.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Globals
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
                                   "resource://gre/modules/DownloadPaths.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "JSONFile",
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/toolkit/modules/tests/xpcshell/test_Log.js
@@ -1,20 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* eslint-disable block-spacing */
 
 var {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-Cu.import("resource://gre/modules/Promise.jsm")
-Cu.import("resource://gre/modules/Log.jsm");
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 
 var testFormatter = {
   format: function format(message) {
     return message.loggerName + "\t" +
       message.levelDesc + "\t" +
       message.message;
   }
 };
--- a/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // See also browser/base/content/test/newtab/.
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Cu.import("resource://gre/modules/NewTabUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { NewTabUtils } = Cu.import("resource://gre/modules/NewTabUtils.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
 
 function run_test() {
   Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, true);
   run_next_test();
 }
 
--- a/toolkit/modules/tests/xpcshell/test_Preferences.js
+++ b/toolkit/modules/tests/xpcshell/test_Preferences.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components;
 
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 function run_test() {
   run_next_test();
 }
 
 add_test(function test_set_get_pref() {
   Preferences.set("test_set_get_pref.integer", 1);
   do_check_eq(Preferences.get("test_set_get_pref.integer"), 1);
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
+++ b/toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
@@ -1,17 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
 
 const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
 const TEST_CHANNEL            = "TestChannel";
 const PREF_PARTNER_A          = "app.partner.test_partner_a";
 const TEST_PARTNER_A          = "TestPartnerA";
 const PREF_PARTNER_B          = "app.partner.test_partner_b";
 const TEST_PARTNER_B          = "TestPartnerB";
 
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
+++ b/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
@@ -1,20 +1,20 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://testing-common/AppInfo.jsm");
-Cu.import("resource://gre/modules/ctypes.jsm");
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { getAppInfo, updateAppInfo } = Cu.import("resource://testing-common/AppInfo.jsm", {});
+let { ctypes } = Cu.import("resource://gre/modules/ctypes.jsm", {});
 
 const PREF_APP_UPDATE_CHANNEL     = "app.update.channel";
 const PREF_APP_PARTNER_BRANCH     = "app.partner.";
 const PREF_DISTRIBUTION_ID        = "distribution.id";
 const PREF_DISTRIBUTION_VERSION   = "distribution.version";
 
 const URL_PREFIX = "http://localhost/";
 
--- a/toolkit/modules/tests/xpcshell/test_client_id.js
+++ b/toolkit/modules/tests/xpcshell/test_client_id.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/ClientID.jsm");
+let { ClientID } = Cu.import("resource://gre/modules/ClientID.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 function run_test() {
   do_get_profile();
   run_next_test();
 }
 
 add_task(function* () {
   const drsPath = OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "state.json");
@@ -25,22 +25,22 @@ add_task(function* () {
   const invalidIDs = [-1, 0.5, "INVALID-UUID", true, "", "3d1e1560-682a-4043-8cf2-aaaaaaaaaaaZ"];
   const PREF_CACHED_CLIENTID = "toolkit.telemetry.cachedClientID";
 
   yield OS.File.makeDir(fhrDir);
 
   // Check that we are importing the FHR client ID.
   let clientID = CommonUtils.generateUUID();
   yield CommonUtils.writeJSON({clientID: clientID}, fhrPath);
-  Assert.equal(clientID, yield ClientID.getClientID());
+  Assert.equal(clientID, (yield ClientID.getClientID()));
 
   // We should persist the ID in DRS now and not pick up a differing ID from FHR.
   yield ClientID._reset();
   yield CommonUtils.writeJSON({clientID: CommonUtils.generateUUID()}, fhrPath);
-  Assert.equal(clientID, yield ClientID.getClientID());
+  Assert.equal(clientID, (yield ClientID.getClientID()));
 
   // We should be guarded against broken FHR data.
   for (let invalidID of invalidIDs) {
     yield ClientID._reset();
     yield OS.File.remove(drsPath);
     yield CommonUtils.writeJSON({clientID: invalidID}, fhrPath);
     clientID = yield ClientID.getClientID();
     Assert.equal(typeof(clientID), 'string');
@@ -57,17 +57,17 @@ add_task(function* () {
 
   // We should be guarded against broken DRS data too and fall back to loading
   // the FHR ID.
   for (let invalidID of invalidIDs) {
     yield ClientID._reset();
     clientID = CommonUtils.generateUUID();
     yield CommonUtils.writeJSON({clientID: clientID}, fhrPath);
     yield CommonUtils.writeJSON({clientID: invalidID}, drsPath);
-    Assert.equal(clientID, yield ClientID.getClientID());
+    Assert.equal(clientID, (yield ClientID.getClientID()));
   }
 
   // We should be guarded against invalid DRS json too.
   yield ClientID._reset();
   yield OS.File.remove(fhrPath);
   yield OS.File.writeAtomic(drsPath, "abcd", {encoding: "utf-8", tmpPath: drsPath + ".tmp"});
   clientID = yield ClientID.getClientID();
   Assert.equal(typeof(clientID), 'string');
--- a/toolkit/modules/tests/xpcshell/test_session_recorder.js
+++ b/toolkit/modules/tests/xpcshell/test_session_recorder.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/SessionRecorder.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://services-common/utils.js");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { SessionRecorder } = Cu.import("resource://gre/modules/SessionRecorder.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { sleep } = Cu.import("resource://services-common/utils.js", {});
 
 
 function run_test() {
   run_next_test();
 }
 
 function monkeypatchStartupInfo(recorder, start=new Date(), offset=500) {
   Object.defineProperty(recorder, "_getStartupInfo", {
--- a/toolkit/modules/tests/xpcshell/test_sqlite.js
+++ b/toolkit/modules/tests/xpcshell/test_sqlite.js
@@ -2,27 +2,26 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 do_get_profile();
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Sqlite.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { PromiseUtils } = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Sqlite } = Cu.import("resource://gre/modules/Sqlite.jsm", {});
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-// To spin the event loop in test.
-Cu.import("resource://services-common/async.js");
+let { Async } = Cu.import("resource://services-common/async.js", {});
 
 function sleep(ms) {
   let deferred = Promise.defer();
 
   let timer = Cc["@mozilla.org/timer;1"]
                 .createInstance(Ci.nsITimer);
 
   timer.initWithCallback({
--- a/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
+++ b/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
@@ -3,22 +3,22 @@
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 do_get_profile();
 
 Cu.import("resource://gre/modules/osfile.jsm");
-  // OS.File doesn't like to be first imported during shutdown
-Cu.import("resource://gre/modules/Sqlite.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
+// OS.File doesn't like to be first imported during shutdown
+let { Sqlite } = Cu.import("resource://gre/modules/Sqlite.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AsyncShutdown } = Cu.import("resource://gre/modules/AsyncShutdown.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 function getConnection(dbName, extraOptions={}) {
   let path = dbName + ".sqlite";
   let options = {path: path};
   for (let [k, v] of Object.entries(extraOptions)) {
     options[k] = v;
   }
 
--- a/toolkit/modules/tests/xpcshell/test_web_channel.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/WebChannel.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { WebChannel } = Cu.import("resource://gre/modules/WebChannel.jsm", {});
 
 const ERROR_ID_ORIGIN_REQUIRED = "WebChannel id and originOrPermission are required.";
 const VALID_WEB_CHANNEL_ID = "id";
 const URL_STRING = "http://example.com";
 const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
 const TEST_PERMISSION_NAME = "test-webchannel-permissions";
 
 var MockWebChannelBroker = {
--- a/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/WebChannel.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { WebChannelBroker } = Cu.import("resource://gre/modules/WebChannel.jsm", {});
 
 const VALID_WEB_CHANNEL_ID = "id";
 const URL_STRING = "http://example.com";
 const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
 
 function run_test() {
   run_next_test();
 }
--- a/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
+++ b/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
@@ -11,18 +11,18 @@ this.EXPORTED_SYMBOLS = [
 ////////////////////////////////////////////////////////////////////////////////
 //// Constants
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 
 const kTaskbarIDWin = "@mozilla.org/windows-taskbar;1";
 const kTaskbarIDMac = "@mozilla.org/widget/macdocksupport;1";
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadTaskbarProgress Object
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -36,17 +36,17 @@ this.EXPORTED_SYMBOLS = [ "DownloadUtils
  * [int time, string units, int subTime, string subUnits]
  * convertTimeUnits(double aSecs)
  */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 
 this.__defineGetter__("gDecimalSymbol", function() {
     delete this.gDecimalSymbol;
       return this.gDecimalSymbol = Number(5.4).toLocaleString().match(/\D/);
 });
--- a/toolkit/mozapps/downloads/content/downloads.js
+++ b/toolkit/mozapps/downloads/content/downloads.js
@@ -12,20 +12,20 @@ const PREF_BDM_ALERTONEXEOPEN = "browser
 const PREF_BDM_SCANWHENDONE = "browser.download.manager.scanWhenDone";
 
 const nsLocalFile = Components.Constructor("@mozilla.org/file/local;1",
                                            "nsILocalFile", "initWithPath");
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 
 const nsIDM = Ci.nsIDownloadManager;
 
 var gDownloadManager = Cc["@mozilla.org/download-manager;1"].getService(nsIDM);
 var gDownloadManagerUI = Cc["@mozilla.org/download-manager-ui;1"].
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
@@ -11,17 +11,17 @@
  * Tests for the "DownloadPaths.jsm" JavaScript module.
  */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/DownloadPaths.jsm");
+let { DownloadPaths } = Cu.import("resource://gre/modules/DownloadPaths.jsm", {});
 
 /**
  * Provides a temporary save directory.
  *
  * @returns nsIFile pointing to the new or existing directory.
  */
 function createTemporarySaveDirectory()
 {
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
+let { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
 
 const gDecimalSymbol = Number(5.4).toLocaleString().match(/\D/);
 function _(str) {
   return str.replace(/\./g, gDecimalSymbol);
 }
 
 function testConvertByteUnits(aBytes, aValue, aUnit)
 {
--- a/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
@@ -4,17 +4,17 @@
 
 /**
  * Test bug 420482 by making sure multiple consumers of DownloadUtils gets the
  * same time remaining time if they provide the same time left but a different
  * "last time".
  */
 
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
+let { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
 
 function run_test()
 {
   // Simulate having multiple downloads requesting time left
   let downloadTimes = {};
   for (let time of [1, 30, 60, 3456, 9999])
     downloadTimes[time] = DownloadUtils.getTimeLeft(time)[0];
 
--- a/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Make sure passing null and nothing to various variable-arg DownloadUtils
  * methods provide the same result.
  */
 
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
+let { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
 
 function run_test()
 {
   do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null, null) + "",
               DownloadUtils.getDownloadStatus(1000) + "");
   do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null) + "",
               DownloadUtils.getDownloadStatus(1000, null) + "");
 
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -16,17 +16,17 @@ const Cu = Components.utils;
 if ("@mozilla.org/xre/app-info;1" in Cc) {
   let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
   if (runtime.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
     // Refuse to run in child processes.
     throw new Error("You cannot use the AddonManager in child processes!");
   }
 }
 
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 
 const MOZ_COMPATIBILITY_NIGHTLY = !['aurora', 'beta', 'release', 'esr'].includes(AppConstants.MOZ_UPDATE_CHANNEL);
 
 const PREF_BLOCKLIST_PINGCOUNTVERSION = "extensions.blocklist.pingCountVersion";
 const PREF_DEFAULT_PROVIDERS_ENABLED  = "extensions.defaultProviders.enabled";
 const PREF_EM_UPDATE_ENABLED          = "extensions.update.enabled";
 const PREF_EM_LAST_APP_VERSION        = "extensions.lastAppVersion";
 const PREF_EM_LAST_PLATFORM_VERSION   = "extensions.lastPlatformVersion";
@@ -70,19 +70,19 @@ const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 const WEBAPI_INSTALL_HOSTS = ["addons.mozilla.org", "addons.cdn.mozilla.net", "testpilot.firefox.com"];
 const WEBAPI_TEST_INSTALL_HOSTS = [
   "addons.allizom.org", "addons-stage-cdn.allizom.org",
   "addons-dev.allizom.org", "addons-dev-cdn-allizom.org",
   "testpilot.stage.mozaws.net", "testpilot.dev.mozaws.net",
   "example.com",
 ];
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AsyncShutdown } = Cu.import("resource://gre/modules/AsyncShutdown.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/addons/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
@@ -101,17 +101,17 @@ this.EXPORTED_SYMBOLS = [ "AddonManager"
 const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
 
 // A list of providers to load by default
 const DEFAULT_PROVIDERS = [
   "resource://gre/modules/addons/XPIProvider.jsm",
   "resource://gre/modules/LightweightThemeManager.jsm"
 ];
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 // Configure a logger at the parent 'addons' level to format
 // messages for all the modules under addons.*
 const PARENT_LOGGER_ID = "addons";
 var parentLogger = Log.repository.getLogger(PARENT_LOGGER_ID);
 parentLogger.level = Log.Level.Warn;
 var formatter = new Log.BasicFormatter();
 // Set parent logger (and its children) to append to
 // the Javascript section of the Browser Console
--- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm
+++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm
@@ -6,18 +6,18 @@
 
 this.EXPORTED_SYMBOLS = ["ChromeManifestParser"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 const MSG_JAR_FLUSH = "AddonJarFlush";
 
 
 /**
  * Sends local and remote notifications to flush a JAR file cache entry
  *
  * @param aJarFile
--- a/toolkit/mozapps/extensions/DeferredSave.jsm
+++ b/toolkit/mozapps/extensions/DeferredSave.jsm
@@ -3,50 +3,42 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/osfile.jsm");
-/*globals OS*/
-Cu.import("resource://gre/modules/Promise.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 // Make it possible to mock out timers for testing
 var MakeTimer = () => Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
 this.EXPORTED_SYMBOLS = ["DeferredSave"];
 
 // If delay parameter is not provided, default is 50 milliseconds.
 const DEFAULT_SAVE_DELAY_MS = 50;
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 //Configure a logger at the parent 'DeferredSave' level to format
 //messages for all the modules under DeferredSave.*
 const DEFERREDSAVE_PARENT_LOGGER_ID = "DeferredSave";
 var parentLogger = Log.repository.getLogger(DEFERREDSAVE_PARENT_LOGGER_ID);
 parentLogger.level = Log.Level.Warn;
 var formatter = new Log.BasicFormatter();
 //Set parent logger (and its children) to append to
 //the Javascript section of the Browser Console
 parentLogger.addAppender(new Log.ConsoleAppender(formatter));
 //Set parent logger (and its children) to
 //also append to standard out
 parentLogger.addAppender(new Log.DumpAppender(formatter));
 
-//Provide the ability to enable/disable logging
-//messages at runtime.
-//If the "extensions.logging.enabled" preference is
-//missing or 'false', messages at the WARNING and higher
-//severity should be logged to the JS console and standard error.
-//If "extensions.logging.enabled" is set to 'true', messages
-//at DEBUG and higher should go to JS console and standard error.
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
 const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
 
 /**
 * Preference listener which listens for a change in the
 * "extensions.logging.enabled" preference and changes the logging level of the
 * parent 'addons' level logger accordingly.
--- a/toolkit/mozapps/extensions/addonManager.js
+++ b/toolkit/mozapps/extensions/addonManager.js
@@ -28,18 +28,18 @@ const MSG_PROMISE_REQUEST  = "WebAPIProm
 const MSG_PROMISE_RESULT   = "WebAPIPromiseResult";
 const MSG_INSTALL_EVENT    = "WebAPIInstallEvent";
 const MSG_INSTALL_CLEANUP  = "WebAPICleanup";
 const MSG_ADDON_EVENT_REQ  = "WebAPIAddonEventRequest";
 const MSG_ADDON_EVENT      = "WebAPIAddonEvent";
 
 const CHILD_SCRIPT = "resource://gre/modules/addons/Content.js";
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 var gSingleton = null;
 
 function amManager() {
   Cu.import("resource://gre/modules/AddonManager.jsm");
   /*globals AddonManagerPrivate*/
 
   Services.mm.loadFrameScript(CHILD_SCRIPT, true);
--- a/toolkit/mozapps/extensions/amInstallTrigger.js
+++ b/toolkit/mozapps/extensions/amInstallTrigger.js
@@ -1,20 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 
 const XPINSTALL_MIMETYPE   = "application/x-xpinstall";
 
 const MSG_INSTALL_ENABLED  = "WebInstallerIsInstallEnabled";
 const MSG_INSTALL_ADDONS   = "WebInstallerInstallAddonsFromWebpage";
 const MSG_INSTALL_CALLBACK = "WebInstallerInstallCallback";
 
 
--- a/toolkit/mozapps/extensions/amWebAPI.js
+++ b/toolkit/mozapps/extensions/amWebAPI.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 
 const MSG_PROMISE_REQUEST  = "WebAPIPromiseRequest";
 const MSG_PROMISE_RESULT   = "WebAPIPromiseResult";
 const MSG_INSTALL_EVENT    = "WebAPIInstallEvent";
 const MSG_INSTALL_CLEANUP  = "WebAPICleanup";
 const MSG_ADDON_EVENT_REQ  = "WebAPIAddonEventRequest";
 const MSG_ADDON_EVENT      = "WebAPIAddonEvent";
 
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -11,34 +11,34 @@
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "PromptUtils", "resource://gre/modules/SharedPromptUtils.jsm");
 
 const URI_XPINSTALL_DIALOG = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
 
 // Installation can begin from any of these states
 const READY_STATES = [
   AddonManager.STATE_AVAILABLE,
   AddonManager.STATE_DOWNLOAD_FAILED,
   AddonManager.STATE_INSTALL_FAILED,
   AddonManager.STATE_CANCELLED
 ];
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.weblistener";
 
 // Create a new logger for use by the Addons Web Listener
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 function notifyObservers(aTopic, aBrowser, aUri, aInstalls) {
   let info = {
--- a/toolkit/mozapps/extensions/content/about.js
+++ b/toolkit/mozapps/extensions/content/about.js
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 /* import-globals-from ../../../content/contentAreaUtils.js */
 
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/AddonManager.jsm");
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
 
 function init() {
   var addon = window.arguments[0];
   var extensionsStrings = document.getElementById("extensionsStrings");
 
   document.documentElement.setAttribute("addontype", addon.type);
 
   var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
--- a/toolkit/mozapps/extensions/content/eula.js
+++ b/toolkit/mozapps/extensions/content/eula.js
@@ -2,17 +2,17 @@
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var Cu = Components.utils;
-Cu.import("resource://gre/modules/AddonManager.jsm");
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
 
 function Startup() {
   var bundle = document.getElementById("extensionsStrings");
   var addon = window.arguments[0].addon;
 
   document.documentElement.setAttribute("addontype", addon.type);
 
   var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -7,21 +7,21 @@
 /* import-globals-from ../../../content/contentAreaUtils.js */
 /*globals XMLStylesheetProcessingInstruction*/
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { AddonRepository } = Cu.import("resource://gre/modules/addons/AddonRepository.jsm", {});
 
 const CONSTANTS = {};
 Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
 const SIGNING_REQUIRED = CONSTANTS.REQUIRE_SIGNING ?
                          true :
                          Services.prefs.getBoolPref("xpinstall.signatures.required");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
--- a/toolkit/mozapps/extensions/content/newaddon.js
+++ b/toolkit/mozapps/extensions/content/newaddon.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
 
 var gAddon = null;
 
 // If the user enables the add-on through some other UI close this window
 var EnableListener = {
   onEnabling: function(aAddon) {
     if (aAddon.id == gAddon.id)
       window.close();
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -61,17 +61,17 @@ const BLANK_DB = function() {
   return {
     addons: new Map(),
     schema: DB_SCHEMA
   };
 }
 
 const TOOLKIT_ID     = "toolkit@mozilla.org";
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.repository";
 
 // Create a new logger for use by the Addons Repository
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 // A map between XML keys to AddonSearchResult keys for string values
 // that require no extra parsing from XML
--- a/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
@@ -3,35 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/*globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/FileUtils.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
 
 const KEY_PROFILEDIR  = "ProfD";
 const FILE_DATABASE   = "addons.sqlite";
 const LAST_DB_SCHEMA   = 4;
 
 // Add-on properties present in the columns of the database
 const PROP_SINGLE = ["id", "type", "name", "version", "creator", "description",
                      "fullDescription", "developerComments", "eula",
                      "homepageURL", "supportURL", "contributionURL",
                      "contributionAmount", "averageRating", "reviewCount",
                      "reviewURL", "totalDownloads", "weeklyDownloads",
                      "dailyUsers", "sourceURI", "repositoryStatus", "size",
                      "updateDate"];
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.repository.sqlmigrator";
 
 // Create a new logger for use by the Addons Repository SQL Migrator
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 this.EXPORTED_SYMBOLS = ["AddonRepository_SQLiteMigrator"];
 
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -12,22 +12,22 @@ var EXPORTED_SYMBOLS = ["AddonTestUtils"
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const CERTDB_CONTRACTID = "@mozilla.org/security/x509certdb;1";
 const CERTDB_CID = Components.ID("{fb0bbc5c-452e-4783-b32c-80124693d871}");
 
 
 Cu.importGlobalProperties(["fetch", "TextEncoder"]);
 
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { AsyncShutdown } = Cu.import("resource://gre/modules/AsyncShutdown.jsm", {});
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
 const {OS} = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Extension",
                                   "resource://gre/modules/Extension.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "rdfService",
--- a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
@@ -41,17 +41,17 @@ XPCOMUtils.defineLazyGetter(this, "CertU
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 var gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
            getService(Ci.nsIRDFService);
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.update-checker";
 
 // Create a new logger for use by the Addons Update Checker
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 /**
  * A serialisation method for RDF data that produces an identical string
--- a/toolkit/mozapps/extensions/internal/E10SAddonsRollout.jsm
+++ b/toolkit/mozapps/extensions/internal/E10SAddonsRollout.jsm
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "isAddonPartOfE10SRollout" ];
 
 const Cu = Components.utils;
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const PREF_E10S_ADDON_BLOCKLIST = "extensions.e10s.rollout.blocklist";
 const PREF_E10S_ADDON_POLICY    = "extensions.e10s.rollout.policy";
 
 const ADDONS = {
   "Greasemonkey": { // Greasemonkey
     id: "{e4a8a97b-f2ed-450b-b12d-ee082ba24781}", minVersion: "3.8",
   },
--- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/GMPProvider.jsm
@@ -5,29 +5,26 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [];
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/*globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-/*globals OS*/
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/GMPUtils.jsm");
-/*globals EME_ADOBE_ID, GMP_PLUGIN_IDS, GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID */
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { EME_ADOBE_ID, GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID } = Cu.import("resource://gre/modules/GMPUtils.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(
   this, "GMPInstallManager", "resource://gre/modules/GMPInstallManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(
   this, "setTimeout", "resource://gre/modules/Timer.jsm");
 
 const URI_EXTENSION_STRINGS  = "chrome://mozapps/locale/extensions/extensions.properties";
 const STRING_TYPE_NAME       = "type.%ID%.name";
--- a/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
+++ b/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
@@ -4,17 +4,17 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["LightweightThemeImageOptimizer"];
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
   "resource://gre/modules/FileUtils.jsm");
 
 const ORIGIN_TOP_RIGHT = 1;
--- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm
@@ -5,26 +5,25 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [];
 
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/*globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Services.jsm");
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const URI_EXTENSION_STRINGS  = "chrome://mozapps/locale/extensions/extensions.properties";
 const STRING_TYPE_NAME       = "type.%ID%.name";
 const LIST_UPDATED_TOPIC     = "plugins-list-updated";
 const FLASH_MIME_TYPE        = "application/x-shockwave-flash";
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.plugins";
 
 // Create a new logger for use by the Addons Plugin Provider
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 function getIDHashForString(aStr) {
   // return the two-digit hexadecimal code for a byte
--- a/toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
@@ -16,25 +16,25 @@ const LOCAL_EME_SOURCES = [{
   "id": "gmp-widevinecdm",
   "src": "chrome://global/content/gmp-sources/widevinecdm.json"
 }];
 
 this.EXPORTED_SYMBOLS = [ "ProductAddonChecker" ];
 
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/CertUtils.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
+let { BadCertHandler, checkCert } = Cu.import("resource://gre/modules/CertUtils.jsm", {});
 /*globals checkCert, BadCertHandler*/
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+let { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
 
 /*globals GMPPrefs */
 XPCOMUtils.defineLazyModuleGetter(this, "GMPPrefs",
                                   "resource://gre/modules/GMPUtils.jsm");
 
 /*globals OS */
 
 XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -1,30 +1,29 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
+/* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = ["XPIProvider"];
 
 const CONSTANTS = {};
 Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
 const { ADDON_SIGNING, REQUIRE_SIGNING } = CONSTANTS
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/*globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/addons/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
                                   "resource://gre/modules/ChromeManifestParser.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionData",
@@ -293,17 +292,17 @@ const MSG_MESSAGE_MANAGER_CACHES_FLUSH =
 
 var gGlobalScope = this;
 
 /**
  * Valid IDs fit this pattern.
  */
 var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}|[a-z0-9-\._]*\@[a-z0-9-\._]+)$/i;
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.xpi";
 
 // Create a new logger for use by all objects in this Addons XPI Provider module
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 const LAZY_OBJECTS = ["XPIDatabase", "XPIDatabaseReconcile"];
 /*globals XPIDatabase, XPIDatabaseReconcile*/
@@ -1518,18 +1517,18 @@ var loadManifestFromZipReader = Task.asy
                     "install manifest");
   }
 
   let uri = buildJarURI(aZipReader.file, entry);
 
   let isWebExtension = (entry == FILE_WEB_MANIFEST);
 
   let addon = isWebExtension ?
-              yield loadManifestFromWebManifest(uri) :
-              yield loadFromRDF(uri);
+              (yield loadManifestFromWebManifest(uri)) :
+              (yield loadFromRDF(uri));
 
   addon._sourceBundle = aZipReader.file;
   addon._installLocation = aInstallLocation;
 
   addon.size = 0;
   let entries = aZipReader.findEntries(null);
   while (entries.hasMore())
     addon.size += aZipReader.getEntry(entries.getNext()).realSize;
--- a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
@@ -10,37 +10,36 @@
           isUsableAddon, recordAddonTelemetry, applyBlocklistChanges,
           flushChromeCaches, canRunInSafeMode*/
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/*globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Preferences.jsm");
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { AddonManager, AddonManagerPrivate } = Cu.import("resource://gre/modules/AddonManager.jsm", {});
+let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/addons/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
                                   "resource://gre/modules/DeferredSave.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "Blocklist",
                                    "@mozilla.org/extensions/blocklist;1",
                                    Ci.nsIBlocklistService);
 
-Cu.import("resource://gre/modules/Log.jsm");
+let { Log } = Cu.import("resource://gre/modules/Log.jsm", {});
 const LOGGER_ID = "addons.xpi-utils";
 
 // Create a new logger for use by the Addons XPI Provider Utils
 // (Requires AddonManager.jsm)
 var logger = Log.repository.getLogger(LOGGER_ID);
 
 const KEY_PROFILEDIR                  = "ProfD";
 const FILE_DATABASE                   = "extensions.sqlite";
--- a/toolkit/mozapps/extensions/test/AddonManagerTesting.jsm
+++ b/toolkit/mozapps/extensions/test/AddonManagerTesting.jsm
@@ -8,18 +8,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "AddonManagerTesting",
 ];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 
 this.AddonManagerTesting = {
   /**
    * Get the add-on that is specified by its ID.
    *
--- a/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 "use strict";
 
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
+let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
 var {AddonTestUtils} = Cu.import("resource://testing-common/AddonManagerTesting.jsm", {});
 var GMPScope = Cu.import("resource://gre/modules/addons/GMPProvider.jsm");
 
 const TEST_DATE = new Date(2013, 0, 1, 12);
 
 var gManagerWindow;
 var gCategoryUtilities;
 var gIsEnUsLocale;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_gfx.js
@@ -1,11 +1,11 @@
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const TEST_APP_ID            = "xpcshell@tests.mozilla.org";
 
 
 const EVENT_NAME = "blocklist-data-gfxItems";
 
 const SAMPLE_GFX_RECORD = {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
@@ -4,18 +4,18 @@
 
 // Tests blocking of extensions by ID, name, creator, homepageURL, updateURL
 // and RegExps for each. See bug 897735.
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver = new HttpServer();
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/test_blocklist_metadata_filters_1.xml", testserver);
 
 const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
@@ -9,18 +9,18 @@ var {classes: Cc, interfaces: Ci, utils:
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 XPCOMUtils.defineLazyGetter(this, "gPref", function bls_gPref() {
   return Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).
          QueryInterface(Ci.nsIPrefBranch);
 });
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver = new HttpServer();
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/test_blocklist_prefs_1.xml", testserver);
 
 const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
@@ -5,18 +5,18 @@
 // Checks that blocklist entries using RegExp work as expected. This only covers
 // behavior specific to RegExp entries - general behavior is already tested
 // in test_blocklistchange.js.
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver = new HttpServer();
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/test_blocklist_regexp_1.xml", testserver);
 
 const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
@@ -30,17 +30,17 @@
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 // Allow insecure updates
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false)
 
 var testserver = createHttpServer();
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
@@ -7,18 +7,18 @@ const PREF_MATCH_OS_LOCALE = "intl.local
 const PREF_SELECTED_LOCALE = "general.useragent.locale";
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 // This is the data we expect to see sent as part of the update url.
 var EXPECTED = [
   {
     id: "bug335238_1@tests.mozilla.org",
     version: "1.3.4",
     maxAppVersion: "5",
     status: "userEnabled",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver = new HttpServer();
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/test_bug393285.xml", testserver);
 
 const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
@@ -7,18 +7,18 @@ var addonIDs = ["test_bug393285_1@tests.
                 "test_bug393285_2@tests.mozilla.org",
                 "test_bug393285_3a@tests.mozilla.org",
                 "test_bug393285_4@tests.mozilla.org"];
 
 var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver = new HttpServer();
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/test_bug393285.xml", testserver);
 
 const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 var ADDONS = [{
   id: "test_bug449027_1@tests.mozilla.org",
   name: "Bug 449027 Addon Test 1",
   version: "5",
   start: false,
   appBlocks: false,
   toolkitBlocks: false
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
@@ -5,18 +5,18 @@
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 
 // register static files with server and interpolate port numbers in them
 mapFile("/data/bug455906_warn.xml", gTestserver);
 mapFile("/data/bug455906_start.xml", gTestserver);
 mapFile("/data/bug455906_block.xml", gTestserver);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 const nsIBLS = Ci.nsIBlocklistService;
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 var gBlocklist = null;
 var gPrefs = null;
 var gTestserver = null;
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
@@ -9,17 +9,17 @@ const PREF_EM_SHOW_MISMATCH_UI        = 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver;
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 var gInstallUpdate = false;
 var gCheckUpdates = false;
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests whether
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_bug619730.xml", gTestserver);
 
 function load_blocklist(file, aCallback) {
   Services.obs.addObserver(function() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which differs only on device ID, but otherwise
-// exactly matches the blacklist entry, is not blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a new-enough driver bypasses the blacklist, even if the rest of
-// the attributes match the blacklist entry.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which is newer than the equal
-// blacklist entry is allowed.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which is older than the equal
-// blacklist entry is correctly allowed.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which exactly matches the equal
-// blacklist entry is successfully blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which is lower than the greater-than-or-equal
-// blacklist entry is allowed.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which exactly matches the greater-than-or-equal
-// blacklist entry is successfully blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which exactly matches the blacklist entry is
-// successfully blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which exactly matches the blacklist entry is
-// successfully blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which differs only on OS version, but otherwise
-// exactly matches the blacklist entry, is not blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
@@ -1,19 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether new OS versions are matched properly.
-// Uses test_gfxBlacklist_OS.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist_OSVersion.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether blocklists specifying new OSeswcorrectly don't block if driver
-// versions are appropriately up-to-date.
-// Uses test_gfxBlacklist_OS.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist_OSVersion.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether old OS versions are not matched when the blacklist contains
-// only new OS versions.
-// Uses test_gfxBlacklist_OS.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist_OSVersion.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
@@ -1,20 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This should eventually be moved to head_addons.js
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which differs only on vendor, but otherwise
-// exactly matches the blacklist entry, is not blocked.
-// Uses test_gfxBlacklist.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
@@ -1,19 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-// Test whether a machine which exactly matches the blacklist entry is
-// successfully blocked.
-// Uses test_gfxBlacklist_AllOS.xml
-
-Cu.import("resource://testing-common/httpd.js");
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var gTestserver = new HttpServer();
 gTestserver.start(-1);
 gPort = gTestserver.identity.primaryPort;
 mapFile("/data/test_gfxBlacklist_AllOS.xml", gTestserver);
 
 function get_platform() {
   var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 var GMPScope = Cu.import("resource://gre/modules/addons/GMPProvider.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
+let { AppConstants } = Cu.import("resource://gre/modules/AppConstants.jsm", {});
+let { UpdateUtils } = Cu.import("resource://gre/modules/UpdateUtils.jsm", {});
 
 XPCOMUtils.defineLazyGetter(this, "pluginsBundle",
   () => Services.strings.createBundle("chrome://global/locale/plugins.properties"));
 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 
 var gMockAddons = new Map();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js
@@ -5,19 +5,19 @@
 // This verifies that add-ons can be installed from XPI files
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 // install.rdf size, icon.png, icon64.png size
 const ADDON1_SIZE = 705 + 16 + 16;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var testserver;
 var gInstallDate;
 var gInstall = null;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
@@ -5,19 +5,19 @@
 // This verifies that add-ons can be installed from XPI files
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 // install.rdf size, icon.png, icon64.png size
 const ADDON1_SIZE = 705 + 16 + 16;
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://testing-common/httpd.js");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
+let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
 
 var testserver;
 var gInstallDate;
 var gInstall = null;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_metadata_update.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_metadata_update.js
@@ -23,17 +23,17 @@ Services.prefs.setBoolPref("extensions.c
 // None of this works without the add-on repository cache
 Services.prefs.setBoolPref("extensions.getAddons.cache.enabled", true);
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 var testserver;
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 // This will be called to show the compatibility update dialog.
 var WindowWatcher = {
   expected: false,
--- a/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const { utils: Cu, interfaces: Ci, classes: Cc, results: Cr } = Components;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 // Allow insecure updates
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false)
 
 const testserver = createHttpServer();
 gPort = testserver.identity.primaryPort;
 testserver.registerDirectory("/data/", do_get_file("data"));
 
--- a/toolkit/mozapps/handling/content/dialog.js
+++ b/toolkit/mozapps/handling/content/dialog.js
@@ -28,17 +28,17 @@
  *   The nsIInterfaceRequestor of the parent window; may be null
  */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/SharedPromptUtils.jsm");
+let { EnableDelayHelper } = Cu.import("resource://gre/modules/SharedPromptUtils.jsm", {});
 
 
 var dialog = {
   //////////////////////////////////////////////////////////////////////////////
   //// Member Variables
 
   _handlerInfo: null,
   _URI: null,
--- a/toolkit/mozapps/installer/precompile_cache.js
+++ b/toolkit/mozapps/installer/precompile_cache.js
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // see http://mxr.mozilla.org/mozilla-central/source/services/sync/Weave.js#76
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Services.jsm");
+let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const rph = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
 
 function endsWith(str, end) {
   return str.slice(-end.length) == end;
 }
 
 function jar_entries(jarReader, pattern) {
--- a/toolkit/mozapps/update/tests/data/shared.js
+++ b/toolkit/mozapps/update/tests/data/shared.js
@@ -1,16 +1,10 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Shared code for xpcshell and mochitests-chrome */
-
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+let { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 
 const PREF_APP_UPDATE_AUTO                 = "app.update.auto";
 const PREF_APP_UPDATE_BACKGROUNDERRORS     = "app.update.backgroundErrors";
 const PREF_APP_UPDATE_BACKGROUNDMAXERRORS  = "app.update.backgroundMaxErrors";
 const PREF_APP_UPDATE_CERT_REQUIREBUILTIN  = "app.update.cert.requireBuiltIn";
 const PREF_APP_UPDATE_CHANNEL              = "app.update.channel";
 const PREF_APP_UPDATE_ENABLED              = "app.update.enabled";
 const PREF_APP_UPDATE_IDLETIME             = "app.update.idletime";
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
@@ -1,13 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://testing-common/MockRegistrar.jsm");
+let { MockRegistrar } = Cu.import("resource://testing-common/MockRegistrar.jsm", {});
 
 function run_test() {
   setupTestCommon();
 
   debugDump("testing nsIUpdatePrompt notifications should not be displayed " +
             "when showUpdateAvailable is called for an unsupported system " +
             "update when the unsupported notification has already been " +
             "shown (bug 843497)");