Bug 1582056 part 3 - Convert all remaining Mozmill helper modules to JSMs; r=mkmelin DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 25 Sep 2019 21:00:53 +1200
changeset 36945 284f2743822fb496e79f927afcfa23dc4ee7c5cb
parent 36944 19ae7a021b57cc3d81b5f95a8aa3f911c4301348
child 36946 7eda6c6992b84826ff26188e3a7f0341404402f4
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersmkmelin
bugs1582056
Bug 1582056 part 3 - Convert all remaining Mozmill helper modules to JSMs; r=mkmelin DONTBUILD
calendar/test/mozmill/cal-recurrence/testAnnualRecurrence.js
calendar/test/mozmill/cal-recurrence/testBiweeklyRecurrence.js
calendar/test/mozmill/cal-recurrence/testDailyRecurrence.js
calendar/test/mozmill/cal-recurrence/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/cal-recurrence/testWeeklyNRecurrence.js
calendar/test/mozmill/cal-recurrence/testWeeklyUntilRecurrence.js
calendar/test/mozmill/cal-recurrence/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/eventDialog/testAlarmDialog.js
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
calendar/test/mozmill/eventDialog/testEventDialogSize.js
calendar/test/mozmill/eventDialog/testUTF8.js
calendar/test/mozmill/invitations/test-imip-bar-eml.js
calendar/test/mozmill/preferences/testAlarmDefaultValue.js
calendar/test/mozmill/preferences/testCategoryColors.js
calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/shared-modules/CalendarUtils.jsm
calendar/test/mozmill/shared-modules/ItemEditingHelpers.jsm
calendar/test/mozmill/shared-modules/moz.build
calendar/test/mozmill/shared-modules/test-calendar-utils.js
calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
calendar/test/mozmill/testBasicFunctionality.js
calendar/test/mozmill/testLocalICS.js
calendar/test/mozmill/testTimezones.js
calendar/test/mozmill/testTodayPane.js
calendar/test/mozmill/views/testDayView.js
calendar/test/mozmill/views/testMonthView.js
calendar/test/mozmill/views/testMultiweekView.js
calendar/test/mozmill/views/testTaskView.js
calendar/test/mozmill/views/testWeekView.js
mail/test/mozmill/account/test-ab-whitelist.js
mail/test/mozmill/account/test-account-actions.js
mail/test/mozmill/account/test-account-deletion.js
mail/test/mozmill/account/test-account-port-setting.js
mail/test/mozmill/account/test-account-settings-infrastructure.js
mail/test/mozmill/account/test-account-tree.js
mail/test/mozmill/account/test-account-values.js
mail/test/mozmill/account/test-archive-options.js
mail/test/mozmill/account/test-mail-account-setup-wizard.js
mail/test/mozmill/account/test-retest-config.js
mail/test/mozmill/addrbook/test-address-book-panes.js
mail/test/mozmill/addrbook/test-address-book.js
mail/test/mozmill/addrbook/test-update-mailing-list.js
mail/test/mozmill/attachment/test-attachment-events.js
mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
mail/test/mozmill/attachment/test-attachment-menus.js
mail/test/mozmill/attachment/test-attachment-size.js
mail/test/mozmill/attachment/test-attachment.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
mail/test/mozmill/cloudfile/test-cloudfile-manager.js
mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
mail/test/mozmill/composition/test-address-widgets.js
mail/test/mozmill/composition/test-attachment-reminder.js
mail/test/mozmill/composition/test-attachment.js
mail/test/mozmill/composition/test-base64-display.js
mail/test/mozmill/composition/test-blocked-content.js
mail/test/mozmill/composition/test-charset-edit.js
mail/test/mozmill/composition/test-charset-upgrade.js
mail/test/mozmill/composition/test-cp932-display.js
mail/test/mozmill/composition/test-draft-identity.js
mail/test/mozmill/composition/test-drafts.js
mail/test/mozmill/composition/test-eml-actions.js
mail/test/mozmill/composition/test-focus.js
mail/test/mozmill/composition/test-forward-headers.js
mail/test/mozmill/composition/test-forward-rfc822-attach.js
mail/test/mozmill/composition/test-forward-utf8.js
mail/test/mozmill/composition/test-forwarded-content.js
mail/test/mozmill/composition/test-forwarded-eml-actions.js
mail/test/mozmill/composition/test-image-display.js
mail/test/mozmill/composition/test-image-insertion-dialog.js
mail/test/mozmill/composition/test-multipart-related.js
mail/test/mozmill/composition/test-newmsg-compose-identity.js
mail/test/mozmill/composition/test-reply-addresses.js
mail/test/mozmill/composition/test-reply-format-flowed.js
mail/test/mozmill/composition/test-reply-multipart-charset.js
mail/test/mozmill/composition/test-reply-signature.js
mail/test/mozmill/composition/test-save-changes-on-quit.js
mail/test/mozmill/composition/test-send-button.js
mail/test/mozmill/composition/test-send-format.js
mail/test/mozmill/composition/test-signature-init.js
mail/test/mozmill/composition/test-signature-updating.js
mail/test/mozmill/content-policy/test-compose-mailto.js
mail/test/mozmill/content-policy/test-dns-prefetch.js
mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/content-policy/test-js-content-policy.js
mail/test/mozmill/content-policy/test-plugins-policy.js
mail/test/mozmill/content-policy/test-view-source.js
mail/test/mozmill/content-tabs/test-about-support.js
mail/test/mozmill/content-tabs/test-addons-mgr.js
mail/test/mozmill/content-tabs/test-content-tab.js
mail/test/mozmill/content-tabs/test-install-xpi.js
mail/test/mozmill/cookies/test-cookies.js
mail/test/mozmill/downloads/test-about-downloads.js
mail/test/mozmill/folder-display/test-archive-messages.js
mail/test/mozmill/folder-display/test-close-window-on-delete.js
mail/test/mozmill/folder-display/test-columns.js
mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
mail/test/mozmill/folder-display/test-display-name.js
mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
mail/test/mozmill/folder-display/test-folder-pane-visibility.js
mail/test/mozmill/folder-display/test-folder-toolbar.js
mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
mail/test/mozmill/folder-display/test-mail-views.js
mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
mail/test/mozmill/folder-display/test-message-commands.js
mail/test/mozmill/folder-display/test-message-pane-visibility.js
mail/test/mozmill/folder-display/test-message-reloads.js
mail/test/mozmill/folder-display/test-message-size.js
mail/test/mozmill/folder-display/test-message-window.js
mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
mail/test/mozmill/folder-display/test-opening-messages.js
mail/test/mozmill/folder-display/test-pane-focus.js
mail/test/mozmill/folder-display/test-recent-menu.js
mail/test/mozmill/folder-display/test-right-click-middle-click-folders.js
mail/test/mozmill/folder-display/test-right-click-middle-click-messages.js
mail/test/mozmill/folder-display/test-savedsearch-reload-after-compact.js
mail/test/mozmill/folder-display/test-selection.js
mail/test/mozmill/folder-display/test-summarization.js
mail/test/mozmill/folder-display/test-tabs-simple.js
mail/test/mozmill/folder-display/test-virtual-folder-commands.js
mail/test/mozmill/folder-display/test-watch-ignore-thread.js
mail/test/mozmill/folder-pane/test-display-message-with-folder-modes.js
mail/test/mozmill/folder-pane/test-folder-names-in-recent-mode.js
mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
mail/test/mozmill/folder-pane/test-folder-pane.js
mail/test/mozmill/folder-tree-modes/test-custom-folder-tree-mode.js
mail/test/mozmill/folder-tree-modes/test-custom-smart-folder.js
mail/test/mozmill/folder-tree-modes/test-mode-switching.js
mail/test/mozmill/folder-tree-modes/test-smart-folders.js
mail/test/mozmill/folder-tree-modes/test-unread-folders.js
mail/test/mozmill/folder-widget/test-message-filters.js
mail/test/mozmill/im/test-chat-tab-restore.js
mail/test/mozmill/im/test-toolbar-buttons.js
mail/test/mozmill/instrumentation/test-instrument-setup.js
mail/test/mozmill/junk-commands/test-junk-commands.js
mail/test/mozmill/keyboard/test-spacehit.js
mail/test/mozmill/message-header/test-message-header.js
mail/test/mozmill/message-header/test-phishing-bar.js
mail/test/mozmill/message-header/test-reply-identity.js
mail/test/mozmill/message-header/test-reply-to-list-from-address-selection.js
mail/test/mozmill/message-header/test-return-receipt.js
mail/test/mozmill/message-reader/test-bug594646.js
mail/test/mozmill/message-window/test-autohide-menubar.js
mail/test/mozmill/message-window/test-commands.js
mail/test/mozmill/message-window/test-eml-subject.js
mail/test/mozmill/message-window/test-message-sidebar.js
mail/test/mozmill/message-window/test-vcard-actions.js
mail/test/mozmill/message-window/test-view-plaintext.js
mail/test/mozmill/multiple-identities/test-display-names.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/test/mozmill/notification/test-notification.js
mail/test/mozmill/override-main-menu-collapse/test-override-mainmenu-collapse.js
mail/test/mozmill/pref-window/test-font-chooser.js
mail/test/mozmill/quick-filter-bar/test-display-issues.js
mail/test/mozmill/quick-filter-bar/test-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-keyboard-interface.js
mail/test/mozmill/quick-filter-bar/test-sticky-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-toggle-bar.js
mail/test/mozmill/runtest.py
mail/test/mozmill/search-window/test-multiple-search-windows.js
mail/test/mozmill/search-window/test-right-click-to-open-search-window.js
mail/test/mozmill/search-window/test-search-window.js
mail/test/mozmill/session-store/test-session-store.js
mail/test/mozmill/shared-modules/AccountManagerHelpers.jsm
mail/test/mozmill/shared-modules/AddressBookHelpers.jsm
mail/test/mozmill/shared-modules/CloudfileHelpers.jsm
mail/test/mozmill/shared-modules/ComposeHelpers.jsm
mail/test/mozmill/shared-modules/ContentTabHelpers.jsm
mail/test/mozmill/shared-modules/CustomizationHelpers.jsm
mail/test/mozmill/shared-modules/DOMHelpers.jsm
mail/test/mozmill/shared-modules/FolderDisplayHelpers.jsm
mail/test/mozmill/shared-modules/JunkHelpers.jsm
mail/test/mozmill/shared-modules/MouseEventHelpers.jsm
mail/test/mozmill/shared-modules/NNTPHelpers.jsm
mail/test/mozmill/shared-modules/NewMailAccountHelpers.jsm
mail/test/mozmill/shared-modules/PrefTabHelpers.jsm
mail/test/mozmill/shared-modules/QuickFilterBarHelpers.jsm
mail/test/mozmill/shared-modules/SearchWindowHelpers.jsm
mail/test/mozmill/shared-modules/SubscribeWindowHelpers.jsm
mail/test/mozmill/shared-modules/WindowHelpers.jsm
mail/test/mozmill/shared-modules/moz.build
mail/test/mozmill/shared-modules/test-account-manager-helpers.js
mail/test/mozmill/shared-modules/test-address-book-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-backend-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-helpers.js
mail/test/mozmill/shared-modules/test-compose-helpers.js
mail/test/mozmill/shared-modules/test-content-tab-helpers.js
mail/test/mozmill/shared-modules/test-customization-helpers.js
mail/test/mozmill/shared-modules/test-dom-helpers.js
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
mail/test/mozmill/shared-modules/test-junk-helpers.js
mail/test/mozmill/shared-modules/test-mouse-event-helpers.js
mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
mail/test/mozmill/shared-modules/test-nntp-helpers.js
mail/test/mozmill/shared-modules/test-pref-window-helpers.js
mail/test/mozmill/shared-modules/test-quick-filter-bar-helpers.js
mail/test/mozmill/shared-modules/test-search-window-helpers.js
mail/test/mozmill/shared-modules/test-subscribe-window-helpers.js
mail/test/mozmill/smime/test-smime-multipart-alternative.js
mail/test/mozmill/startup-firstrun/test-menubar-collapsed.js
mail/test/mozmill/subscribe/test-subscribe-news-filter.js
mail/test/mozmill/tabmail/test-tabmail-closing.js
mail/test/mozmill/tabmail/test-tabmail-customize.js
mail/test/mozmill/tabmail/test-tabmail-dragndrop.js
mail/test/mozmill/utils/test-extensionSupport.js
mail/test/mozmill/utils/test-iteratorUtils.js
--- a/calendar/test/mozmill/cal-recurrence/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testAnnualRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testAnnualRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var CALENDARNAME, EVENTPATH, CANVAS_BOX, ALLDAY;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate, invokeEventDialog;
 var closeAllEventDialogs, deleteCalendars, createCalendar, menulistSelect;
 
 const STARTYEAR = 1950;
 const EPOCH = 1970;
 
 function setupModule(module) {
@@ -24,20 +20,20 @@ function setupModule(module) {
     handleOccurrencePrompt,
     switchToView,
     goToDate,
     invokeEventDialog,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testAnnualRecurrence() {
   goToDate(controller, STARTYEAR, 1, 1);
 
   // Create yearly recurring all-day event.
   let eventBox = lookupEventBox("day", ALLDAY, null, 1, null);
--- a/calendar/test/mozmill/cal-recurrence/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testBiweeklyRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testBiweeklyRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate, invokeEventDialog;
 var viewForward, closeAllEventDialogs, deleteCalendars, createCalendar, menulistSelect;
 
 const HOUR = 8;
 
 function setupModule(module) {
   controller = mozmill.getMail3PaneController();
@@ -24,20 +20,20 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testBiweeklyRecurrence() {
   goToDate(controller, 2009, 1, 31);
 
   // Create biweekly event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/cal-recurrence/testDailyRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testDailyRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testDailyRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, invokeEventDialog, switchToView, goToDate;
 var viewForward, viewBack, closeAllEventDialogs, createCalendar, deleteCalendars, menulistSelect;
 var setData;
 
 const HOUR = 8;
 
 function setupModule(module) {
@@ -26,23 +22,22 @@ function setupModule(module) {
     goToDate,
     invokeEventDialog,
     viewForward,
     viewBack,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testDailyRecurrence() {
   goToDate(controller, 2009, 1, 1);
 
   // Create daily event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/cal-recurrence/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testLastDayOfMonthRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testLastDayOfMonthRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog, closeAllEventDialogs, deleteCalendars, createCalendar, menulistSelect;
 var REC_DLG_ACCEPT;
@@ -29,23 +25,24 @@ function setupModule(module) {
     handleOccurrencePrompt,
     switchToView,
     goToDate,
     invokeEventDialog,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_ACCEPT } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REC_DLG_ACCEPT } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testLastDayOfMonthRecurrence() {
   goToDate(controller, 2008, 1, 31); // Start with a leap year.
 
   // Create monthly recurring event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/cal-recurrence/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testWeeklyNRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyNRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate, invokeEventDialog;
@@ -32,23 +28,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     deleteCalendars,
     closeAllEventDialogs,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_ACCEPT, REC_DLG_DAYS } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REC_DLG_ACCEPT, REC_DLG_DAYS } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testWeeklyNRecurrence() {
   goToDate(controller, 2009, 1, 5);
 
   // Create weekly recurring event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/cal-recurrence/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testWeeklyUntilRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyUntilRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var SHORT_SLEEP, TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate, invokeEventDialog;
@@ -34,25 +30,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_DAYS, REC_DLG_ACCEPT, REC_DLG_UNTIL_INPUT } = collector.getModule(
-    "item-editing-helpers"
+  ({ REC_DLG_DAYS, REC_DLG_ACCEPT, REC_DLG_UNTIL_INPUT } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
   ));
-  collector.getModule("item-editing-helpers").setupModule(module);
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testWeeklyUntilRecurrence() {
   goToDate(controller, 2009, 1, 5); // Monday
 
   // Create weekly recurring event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/cal-recurrence/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/cal-recurrence/testWeeklyWithExceptionRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyWithExceptionRecurrence";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENT_BOX, CANVAS_BOX;
 var DAY_VIEW, WEEK_VIEW, EVENTPATH;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog, viewForward, closeAllEventDialogs, deleteCalendars, createCalendar;
@@ -38,29 +34,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({
-    REPEAT_DETAILS,
-    REC_DLG_ACCEPT,
-    REC_DLG_DAYS,
-    helpersForEditUI,
-    setData,
-  } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REPEAT_DETAILS, REC_DLG_ACCEPT, REC_DLG_DAYS, helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 function testWeeklyWithExceptionRecurrence() {
   goToDate(controller, 2009, 1, 5);
 
   // Create weekly recurring event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
--- a/calendar/test/mozmill/eventDialog/testAlarmDialog.js
+++ b/calendar/test/mozmill/eventDialog/testAlarmDialog.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testAlarmDialog";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, ALLDAY;
 var helpersForController, switchToView, goToDate, lookupEventBox;
 var invokeEventDialog, viewForward, closeAllEventDialogs, deleteCalendars;
 var createCalendar;
@@ -27,23 +23,20 @@ function setupModule(module) {
     switchToView,
     goToDate,
     lookupEventBox,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
   createCalendar(controller, CALENDARNAME);
 }
 
 function testAlarmDialog() {
   let now = new Date();
 
   switchToView(controller, "day");
   goToDate(controller, now.getFullYear(), now.getMonth() + 1, now.getDate());
--- a/calendar/test/mozmill/eventDialog/testEventDialog.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialog.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testEventDialog";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate, lookupEventBox;
@@ -40,24 +36,22 @@ function setupModule(module) {
     goToDate,
     lookupEventBox,
     invokeEventDialog,
     checkAlarmIcon,
     viewBack,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ EVENT_TABPANELS, ATTENDEES_ROW, helpersForEditUI, setData } = collector.getModule(
-    "item-editing-helpers"
+  ({ EVENT_TABPANELS, ATTENDEES_ROW, helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
   ));
-  collector.getModule("item-editing-helpers").setupModule(module);
 
   createCalendar(controller, CALENDARNAME);
 }
 
 function testEventDialog() {
   let dateFormatter = cal.getDateFormatter();
   let now = new Date();
 
--- a/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
@@ -1,24 +1,25 @@
 /* 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 MODULE_NAME = "testEventDialogModificationPrompt";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers", "folder-display-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var CALENDARNAME, EVENT_BOX, CANVAS_BOX, EVENTPATH;
-var helpersForController, invokeEventDialog, createCalendar, closeAllEventDialogs, deleteCalendars;
+var helpersForController,
+  switchToView,
+  invokeEventDialog,
+  createCalendar,
+  closeAllEventDialogs,
+  deleteCalendars;
 var goToDate;
 var setData;
 var mark_failure;
 
 const TIMEOUT_COMMON_DIALOG = 3000;
 var savePromptAppeared = false;
 var failPoints = {
   first: "no change",
@@ -31,30 +32,31 @@ var { date1, date2, date3, data, newline
 function setupModule(module) {
   controller = mozmill.getMail3PaneController();
   ({
     CALENDARNAME,
     EVENT_BOX,
     CANVAS_BOX,
     EVENTPATH,
     helpersForController,
+    switchToView,
     invokeEventDialog,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     goToDate,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
+  ({ mark_failure } = ChromeUtils.import(
+    "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+  ));
 
-  ({ mark_failure } = collector.getModule("folder-display-helpers"));
-
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 }
 
 // Test that closing an event dialog with no changes does not prompt for save.
 function testEventDialogModificationPrompt() {
   goToDate(controller, 2009, 1, 1);
 
   let createbox = lookupEventBox("day", CANVAS_BOX, null, 1, 8);
--- a/calendar/test/mozmill/eventDialog/testEventDialogSize.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialogSize.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testEventDialogSize";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var helpersForController, invokeEventDialog, createCalendar, closeAllEventDialogs, deleteCalendars;
 var CALENDARNAME;
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const SMALL_TOLERANCE = 5;
 const LARGE_TOLERANCE = 10;
 
@@ -18,18 +14,17 @@ function setupModule(module) {
   controller = mozmill.getMail3PaneController();
   ({
     helpersForController,
     invokeEventDialog,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     CALENDARNAME,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
   createCalendar(controller, CALENDARNAME);
 }
 
 function testEventDialog() {
   dump("#ltnNewEvent click\n");
   controller.mainMenu.click("#ltnNewEvent");
--- a/calendar/test/mozmill/eventDialog/testUTF8.js
+++ b/calendar/test/mozmill/eventDialog/testUTF8.js
@@ -1,41 +1,42 @@
 /* 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 MODULE_NAME = "testUTF8";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var EVENT_BOX, CANVAS_BOX;
-var helpersForController, invokeEventDialog, closeAllEventDialogs, createCalendar, deleteCalendars;
+var helpersForController,
+  switchToView,
+  invokeEventDialog,
+  closeAllEventDialogs,
+  createCalendar,
+  deleteCalendars;
 var setData;
 
 var UTF8STRING = " 💣 💥  ☣  ";
 
 function setupModule(module) {
   controller = mozmill.getMail3PaneController();
   ({
     EVENT_BOX,
     CANVAS_BOX,
     helpersForController,
+    switchToView,
     invokeEventDialog,
     closeAllEventDialogs,
     createCalendar,
     deleteCalendars,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
 
+  switchToView(controller, "day");
   createCalendar(controller, UTF8STRING);
   Services.prefs.setStringPref("calendar.categories.names", UTF8STRING);
 }
 
 function testUTF8() {
   // Create new event.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, 8);
   invokeEventDialog(controller, eventBox, (event, iframe) => {
--- a/calendar/test/mozmill/invitations/test-imip-bar-eml.js
+++ b/calendar/test/mozmill/invitations/test-imip-bar-eml.js
@@ -1,32 +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/. */
 
 /**
  * Test that the IMIP bar behaves properly for eml files.
  */
 
-/* import-globals-from ../../../../mail/test/mozmill/shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "testInvitations";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { open_message_from_file } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
-function setupModule(module) {
-  for (let dep of MODULE_REQUIRES) {
-    collector.getModule(dep).installInto(module);
-  }
-}
-
 /**
  * Test that when opening a message containing an event, the IMIP bar shows.
  */
 function test_event_from_eml() {
   let thisFilePath = os.getFileForPath(__file__);
   let file = os.getFileForPath(os.abspath("./message-containing-event.eml", thisFilePath));
 
   let msgc = open_message_from_file(file);
--- a/calendar/test/mozmill/preferences/testAlarmDefaultValue.js
+++ b/calendar/test/mozmill/preferences/testAlarmDefaultValue.js
@@ -1,20 +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/. */
 
 /**
  * Test default alarm settings for events and tasks
  */
 
-var MODULE_NAME = "testAlarmDefaultValue";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "content-tab-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 var { PluralForm } = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
@@ -29,21 +25,21 @@ var prefTab = null;
 function setupModule(module) {
   controller = mozmill.getMail3PaneController();
   ({
     helpersForController,
     invokeEventDialog,
     openLightningPrefs,
     closeLightningPrefs,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
 
-  ({ content_tab_e, content_tab_eid } = collector.getModule("content-tab-helpers"));
-  collector.getModule("content-tab-helpers").setupModule();
+  ({ content_tab_e, content_tab_eid } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+  ));
 }
 
 function testDefaultAlarms() {
   let localeUnitString = cal.l10n.getCalString("unitDays");
   let unitString = PluralForm.get(DEFVALUE, localeUnitString).replace("#1", DEFVALUE);
   let alarmString = (...args) => cal.l10n.getString("calendar-alarms", ...args);
   let originStringEvent = alarmString("reminderCustomOriginBeginBeforeEvent");
   let originStringTask = alarmString("reminderCustomOriginBeginBeforeTask");
--- a/calendar/test/mozmill/preferences/testCategoryColors.js
+++ b/calendar/test/mozmill/preferences/testCategoryColors.js
@@ -1,34 +1,30 @@
 /* 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 MODULE_NAME = "testCategoryColors";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "content-tab-helpers"];
-
 var { wait_for_frame_load } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var helpersForController, openLightningPrefs, closeLightningPrefs;
 var content_tab_e, content_tab_eid;
 
 var prefTab = null;
 
 function setupModule(module) {
   controller = mozmill.getMail3PaneController();
-  ({ helpersForController, openLightningPrefs, closeLightningPrefs } = collector.getModule(
-    "calendar-utils"
+  ({ helpersForController, openLightningPrefs, closeLightningPrefs } = ChromeUtils.import(
+    "resource://testing-common/mozmill/CalendarUtils.jsm"
   ));
-  collector.getModule("calendar-utils").setupModule(controller);
 
-  ({ content_tab_e, content_tab_eid } = collector.getModule("content-tab-helpers"));
-  collector.getModule("content-tab-helpers").setupModule();
+  ({ content_tab_e, content_tab_eid } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+  ));
 }
 
 function testCategoryColors() {
   openLightningPrefs(tab => {
     prefTab = tab;
 
     let listBox = content_tab_e(tab, "categorieslist");
     listBox.scrollIntoView();
--- a/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testAnnualRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var CALENDARNAME, EVENTPATH, CANVAS_BOX, ALLDAY;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog, closeAllEventDialogs, deleteCalendars, createCalendar, menulistSelect;
 
 const STARTYEAR = 1950;
 const EPOCH = 1970;
 
 function setupModule(module) {
@@ -24,20 +20,20 @@ function setupModule(module) {
     handleOccurrencePrompt,
     switchToView,
     goToDate,
     invokeEventDialog,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // Rotate view.
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testAnnualRecurrence() {
   goToDate(controller, STARTYEAR, 1, 1);
--- a/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testBiweeklyRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog,
   viewForward,
   createCalendar,
   closeAllEventDialogs,
   deleteCalendars,
   menulistSelect;
@@ -29,20 +25,20 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testBiweeklyRecurrence() {
   goToDate(controller, 2009, 1, 31);
--- a/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testDailyRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, invokeEventDialog, createCalendar, closeAllEventDialogs, deleteCalendars;
 var switchToView, goToDate, viewForward, viewBack, handleOccurrencePrompt;
 var menulistSelect;
 var setData;
 
 const HOUR = 8;
 
@@ -27,23 +23,22 @@ function setupModule(module) {
     goToDate,
     invokeEventDialog,
     viewForward,
     viewBack,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
 
   // Rotate view.
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testDailyRecurrence() {
--- a/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testLastDayOfMonthRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog, closeAllEventDialogs, deleteCalendars, createCalendar, menulistSelect;
 var REC_DLG_ACCEPT;
@@ -29,23 +25,24 @@ function setupModule(module) {
     invokeEventDialog,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     switchToView,
     goToDate,
     handleOccurrencePrompt,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_ACCEPT } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REC_DLG_ACCEPT } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // Rotate view.
   switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testLastDayOfMonthRecurrence() {
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyNRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
@@ -37,23 +33,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_ACCEPT, REC_DLG_DAYS } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REC_DLG_ACCEPT, REC_DLG_DAYS } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // Rotate view.
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testWeeklyNRecurrence() {
   goToDate(controller, 2009, 1, 5);
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyUntilRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var SHORT_SLEEP, TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENTPATH, EVENT_BOX, CANVAS_BOX;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
@@ -39,25 +35,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ REC_DLG_DAYS, REC_DLG_ACCEPT, REC_DLG_UNTIL_INPUT } = collector.getModule(
-    "item-editing-helpers"
+  ({ REC_DLG_DAYS, REC_DLG_ACCEPT, REC_DLG_UNTIL_INPUT } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
   ));
-  collector.getModule("item-editing-helpers").setupModule(module);
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // Rotate view.
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testWeeklyUntilRecurrence() {
   goToDate(controller, 2009, 1, 5); // Monday
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeeklyWithExceptionRecurrenceRotated";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, EVENT_BOX, CANVAS_BOX;
 var DAY_VIEW, WEEK_VIEW, EVENTPATH;
 var helpersForController, handleOccurrencePrompt, switchToView, goToDate;
 var invokeEventDialog, viewForward, closeAllEventDialogs, deleteCalendars, createCalendar;
@@ -38,29 +34,24 @@ function setupModule(module) {
     switchToView,
     goToDate,
     invokeEventDialog,
     viewForward,
     closeAllEventDialogs,
     deleteCalendars,
     createCalendar,
     menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({
-    REPEAT_DETAILS,
-    REC_DLG_ACCEPT,
-    REC_DLG_DAYS,
-    helpersForEditUI,
-    setData,
-  } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ REPEAT_DETAILS, REC_DLG_ACCEPT, REC_DLG_DAYS, helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
+  switchToView(controller, "day");
   createCalendar(controller, CALENDARNAME);
   // Rotate view.
   controller.mainMenu.click("#ltnViewRotated");
   controller.waitFor(() => eid("day-view").getNode().orient == "horizontal");
 }
 
 function testWeeklyWithExceptionRecurrence() {
   goToDate(controller, 2009, 1, 5);
rename from calendar/test/mozmill/shared-modules/test-calendar-utils.js
rename to calendar/test/mozmill/shared-modules/CalendarUtils.jsm
--- a/calendar/test/mozmill/shared-modules/test-calendar-utils.js
+++ b/calendar/test/mozmill/shared-modules/CalendarUtils.jsm
@@ -1,22 +1,68 @@
 /* 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 MODULE_NAME = "calendar-utils";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "pref-window-helpers"];
+this.EXPORTED_SYMBOLS = [
+  "SHORT_SLEEP",
+  "MID_SLEEP",
+  "TIMEOUT_MODAL_DIALOG",
+  "CALENDARNAME",
+  "CALENDAR_PANEL",
+  "VIEWDECK",
+  "DAY_VIEW",
+  "WEEK_VIEW",
+  "DAYBOX",
+  "LABELDAYBOX",
+  "MULTIWEEK_VIEW",
+  "MONTH_VIEW",
+  "TASK_VIEW",
+  "MINIMONTH",
+  "TODAY_BUTTON",
+  "CALENDARLIST",
+  "TODAY_PANE",
+  "AGENDA_LISTBOX",
+  "EVENTPATH",
+  "ALARM_ICON_PATH",
+  "EVENT_BOX",
+  "CANVAS_BOX",
+  "ALLDAY",
+  "helpersForController",
+  "handleOccurrencePrompt",
+  "switchToView",
+  "goToDate",
+  "invokeEventDialog",
+  "getEventBoxPath",
+  "getEventDetails",
+  "checkAlarmIcon",
+  "viewForward",
+  "viewBack",
+  "closeAllEventDialogs",
+  "deleteCalendars",
+  "createCalendar",
+  "handleNewCalendarWizard",
+  "findEventsInNode",
+  "openLightningPrefs",
+  "closeLightningPrefs",
+  "menulistSelect",
+];
 
+var elementslib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
+var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
+var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
+
+var { close_pref_tab, open_pref_tab } = ChromeUtils.import(
+  "resource://testing-common/mozmill/PrefTabHelpers.jsm"
+);
 var { close_window, plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
 var SHORT_SLEEP = 100;
 var MID_SLEEP = 500;
 var TIMEOUT_MODAL_DIALOG = 30000;
 var CALENDARNAME = "Mozmill";
 
 // These are used in EventBox lookup.
 var EVENT_BOX = 0; // Use when you need an event box.
@@ -69,81 +115,27 @@ var EVENTPATH = `
     /{"tooltip":"itemTooltip","calendar":"${CALENDARNAME.toLowerCase()}"}
 `;
 // Used after "${EVENTPATH}/${getEventDetails([view])}/".
 var ALARM_ICON_PATH = `
     anon({"class":"category-box-stack"})/anon({"align":"center"})/
     anon({"class":"alarm-icons-box"})/anon({"class":"reminder-icon"})
 `;
 
-var open_pref_tab, close_pref_tab;
-
-function setupModule(controller) {
-  // This setup is needed for pref-win-helpers. For some reason, the automatic
-  // loading of modules in shared modules does not setup the module correctly.
-  collector.getModule("folder-display-helpers").setupModule();
-
-  ({ open_pref_tab, close_pref_tab } = collector.getModule("pref-window-helpers"));
-  collector.getModule("pref-window-helpers").setupModule();
-
+function setupModule() {
   // For our tests, we assume that Sunday is start of week.
   Services.prefs.setIntPref("calendar.week.start", 0);
 
   // We are in calendarTests, so we make sure, calendar-tab with day-view is displayed.
+  let controller = mozmill.getMail3PaneController();
   let { eid } = helpersForController(controller);
   controller.click(eid("calendar-tab-button"));
   switchToView(controller, "day");
 }
-
-function installInto(module) {
-  // Copy constants into module.
-  module.SHORT_SLEEP = SHORT_SLEEP;
-  module.MID_SLEEP = MID_SLEEP;
-  module.TIMEOUT_MODAL_DIALOG = TIMEOUT_MODAL_DIALOG;
-  module.CALENDARNAME = CALENDARNAME;
-  module.CALENDAR_PANEL = CALENDAR_PANEL;
-  module.VIEWDECK = VIEWDECK;
-  module.DAY_VIEW = DAY_VIEW;
-  module.WEEK_VIEW = WEEK_VIEW;
-  module.DAYBOX = DAYBOX;
-  module.LABELDAYBOX = LABELDAYBOX;
-  module.MULTIWEEK_VIEW = MULTIWEEK_VIEW;
-  module.MONTH_VIEW = MONTH_VIEW;
-  module.TASK_VIEW = TASK_VIEW;
-  module.MINIMONTH = MINIMONTH;
-  module.TODAY_BUTTON = TODAY_BUTTON;
-  module.CALENDARLIST = CALENDARLIST;
-  module.TODAY_PANE = TODAY_PANE;
-  module.AGENDA_LISTBOX = AGENDA_LISTBOX;
-  module.EVENTPATH = EVENTPATH;
-  module.ALARM_ICON_PATH = ALARM_ICON_PATH;
-  module.EVENT_BOX = EVENT_BOX;
-  module.CANVAS_BOX = CANVAS_BOX;
-  module.ALLDAY = ALLDAY;
-
-  // Now copy helper functions.
-  module.helpersForController = helpersForController;
-  module.handleOccurrencePrompt = handleOccurrencePrompt;
-  module.switchToView = switchToView;
-  module.goToDate = goToDate;
-  module.invokeEventDialog = invokeEventDialog;
-  module.getEventBoxPath = getEventBoxPath;
-  module.getEventDetails = getEventDetails;
-  module.checkAlarmIcon = checkAlarmIcon;
-  module.viewForward = viewForward;
-  module.viewBack = viewBack;
-  module.closeAllEventDialogs = closeAllEventDialogs;
-  module.deleteCalendars = deleteCalendars;
-  module.createCalendar = createCalendar;
-  module.handleNewCalendarWizard = handleNewCalendarWizard;
-  module.findEventsInNode = findEventsInNode;
-  module.openLightningPrefs = openLightningPrefs;
-  module.closeLightningPrefs = closeLightningPrefs;
-  module.menulistSelect = menulistSelect;
-}
+setupModule();
 
 function helpersForController(controller) {
   function selector(sel) {
     return sel.trim().replace(/\n(\s*)/g, "");
   }
 
   return {
     lookup: sel => new elementslib.Lookup(controller.window.document, selector(sel)),
rename from calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
rename to calendar/test/mozmill/shared-modules/ItemEditingHelpers.jsm
--- a/calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
+++ b/calendar/test/mozmill/shared-modules/ItemEditingHelpers.jsm
@@ -1,38 +1,49 @@
 /* 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 MODULE_NAME = "item-editing-helpers";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
+this.EXPORTED_SYMBOLS = [
+  "CATEGORY_LIST",
+  "REPEAT_DETAILS",
+  "EVENT_TABPANELS",
+  "DESCRIPTION_TEXTBOX",
+  "ATTENDEES_ROW",
+  "PERCENT_COMPLETE_INPUT",
+  "DATE_INPUT",
+  "TIME_INPUT",
+  "REC_DLG_ACCEPT",
+  "REC_DLG_DAYS",
+  "REC_DLG_UNTIL_INPUT",
+  "helpersForEditUI",
+  "setData",
+  "setReminderMenulist",
+  "setCategories",
+  "handleAddingAttachment",
+  "setTimezone",
+];
 
+var elementslib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
+
+var {
+  helpersForController,
+  menulistSelect,
+  SHORT_SLEEP,
+  TIMEOUT_MODAL_DIALOG,
+} = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm");
+var { mark_failure } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { augment_controller, plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
-var SHORT_SLEEP, TIMEOUT_MODAL_DIALOG;
-var helpersForController, menulistSelect;
-var mark_failure;
-
-function setupModule(module) {
-  controller = mozmill.getMail3PaneController();
-  ({
-    SHORT_SLEEP,
-    TIMEOUT_MODAL_DIALOG,
-    helpersForController,
-    menulistSelect,
-  } = collector.getModule("calendar-utils"));
-  Object.assign(module, helpersForController(controller));
-
-  ({ mark_failure } = collector.getModule("folder-display-helpers"));
-}
 // Lookup paths and path-snippets.
 // These 5 have to be used with itemEditLookup().
 var CATEGORY_LIST = `
     id("event-grid")/id("event-grid-category-color-row")/id("event-grid-category-color-td")
     /id("item-categories")/id("item-categories-popup")
 `;
 var REPEAT_DETAILS = `
     id("event-grid")/id("event-grid-recurrence-row")/id("event-grid-recurrence-td")/id("event-grid-recurrence-picker-box")/
@@ -73,38 +84,16 @@ var REC_DLG_DAYS = `
     {"flex":"1"}/[1]/id("period-deck")/id("period-deck-weekly-box")/[1]/id("daypicker-weekday")
 `;
 var REC_DLG_UNTIL_INPUT = `
     /id("calendar-event-dialog-recurrence")/id("recurrence-range-groupbox")/[1]/
     id("recurrence-duration")/id("recurrence-range-until-box")/id("repeat-until-date")/
     anon({"class":"datepicker-menulist"})/{"class":"menulist-input"}
 `;
 
-function installInto(module) {
-  // Copy constants into module.
-  module.CATEGORY_LIST = CATEGORY_LIST;
-  module.REPEAT_DETAILS = REPEAT_DETAILS;
-  module.EVENT_TABPANELS = EVENT_TABPANELS;
-  module.DESCRIPTION_TEXTBOX = DESCRIPTION_TEXTBOX;
-  module.ATTENDEES_ROW = ATTENDEES_ROW;
-  module.PERCENT_COMPLETE_INPUT = PERCENT_COMPLETE_INPUT;
-  module.DATE_INPUT = DATE_INPUT;
-  module.TIME_INPUT = TIME_INPUT;
-  module.REC_DLG_ACCEPT = REC_DLG_ACCEPT;
-  module.REC_DLG_DAYS = REC_DLG_DAYS;
-  module.REC_DLG_UNTIL_INPUT = REC_DLG_UNTIL_INPUT;
-  // Now copy helper functions.
-  module.helpersForEditUI = helpersForEditUI;
-  module.setData = setData;
-  module.setReminderMenulist = setReminderMenulist;
-  module.setCategories = setCategories;
-  module.handleAddingAttachment = handleAddingAttachment;
-  module.setTimezone = setTimezone;
-}
-
 function helpersForEditUI(controller) {
   function selector(sel) {
     return sel.trim().replace(/\n(\s*)/g, "");
   }
 
   let isEvent = cal.item.isEvent(controller.window.calendarItem);
 
   let obj = {
--- a/calendar/test/mozmill/shared-modules/moz.build
+++ b/calendar/test/mozmill/shared-modules/moz.build
@@ -1,13 +1,9 @@
 # vim: set filetype=python:
 # 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/.
 
-# Copies the files in this folder to a staging directory in the objdir.
-# Files from mail/test/mozmill/shared-modules are copied into the same
-# directory to allow calendar tests to run. Due to an oddity in the
-# build system, we can't use the same wildcard twice for a destination.
-TEST_HARNESS_FILES.mozmill.stage['shared-modules'] += [
-    'test-calendar-utils.js',
-    'test-item-editing-helpers.js',
+TESTING_JS_MODULES.mozmill += [
+    'CalendarUtils.jsm',
+    'ItemEditingHelpers.jsm',
 ]
--- a/calendar/test/mozmill/testBasicFunctionality.js
+++ b/calendar/test/mozmill/testBasicFunctionality.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testBasicFunctionality";
-var RELATIVE_ROOT = "./shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var TIMEOUT_MODAL_DIALOG, CALENDARNAME, CALENDAR_PANEL, DAY_VIEW, DAYBOX, MINIMONTH, CALENDARLIST;
 var helpersForController, switchToView, deleteCalendars, handleNewCalendarWizard;
@@ -24,18 +20,17 @@ function setupModule(module) {
     DAY_VIEW,
     DAYBOX,
     MINIMONTH,
     CALENDARLIST,
     helpersForController,
     switchToView,
     deleteCalendars,
     handleNewCalendarWizard,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 }
 
 function testSmokeTest() {
   let dateFormatter = cal.getDateFormatter();
 
   // Check for minimonth.
   controller.waitForElement(eid("calMinimonth"));
--- a/calendar/test/mozmill/testLocalICS.js
+++ b/calendar/test/mozmill/testLocalICS.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testLocalICS";
-var RELATIVE_ROOT = "./shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var TIMEOUT_MODAL_DIALOG, CANVAS_BOX, EVENT_BOX;
 var helpersForController, invokeEventDialog, deleteCalendars, handleNewCalendarWizard;
@@ -25,23 +21,20 @@ function setupModule(module) {
   ({
     TIMEOUT_MODAL_DIALOG,
     CANVAS_BOX,
     EVENT_BOX,
     helpersForController,
     invokeEventDialog,
     deleteCalendars,
     handleNewCalendarWizard,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
   // Unique name needed as deleting a calendar only unsubscribes from it and
   // if same file were used on next testrun then previously created event
   // would show up.
   calendarName = calendarTitle = new Date().getTime() + "";
   calendarFile = Services.dirsvc.get("TmpD", Ci.nsIFile);
   calendarFile.append(calendarName + ".ics");
 }
 
--- a/calendar/test/mozmill/testTimezones.js
+++ b/calendar/test/mozmill/testTimezones.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testTimezones";
-var RELATIVE_ROOT = "./shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var CANVAS_BOX, DAY_VIEW;
 var helpersForController, invokeEventDialog, switchToView, goToDate;
 var findEventsInNode, viewForward, viewBack;
 var setData;
 
 var DATES = [
   [2009, 1, 1],
   [2009, 4, 2],
@@ -42,22 +38,20 @@ function setupModule(module) {
     DAY_VIEW,
     helpersForController,
     invokeEventDialog,
     switchToView,
     goToDate,
     findEventsInNode,
     viewForward,
     viewBack,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
 }
 
 function testTimezones1_SetGMT() {
   Services.prefs.setStringPref("calendar.timezone.local", "Europe/London");
 }
 
 function testTimezones2_CreateEvents() {
   goToDate(controller, 2009, 1, 1);
--- a/calendar/test/mozmill/testTodayPane.js
+++ b/calendar/test/mozmill/testTodayPane.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testTodayPane";
-var RELATIVE_ROOT = "./shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var CALENDARNAME, CANVAS_BOX, DAY_VIEW, LABELDAYBOX, TODAY_BUTTON, TODAY_PANE, AGENDA_LISTBOX;
 var helpersForController, invokeEventDialog, viewForward, createCalendar;
 var deleteCalendars;
 var setData;
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 function setupModule(module) {
@@ -23,23 +19,20 @@ function setupModule(module) {
     TODAY_BUTTON,
     TODAY_PANE,
     AGENDA_LISTBOX,
     helpersForController,
     invokeEventDialog,
     viewForward,
     createCalendar,
     deleteCalendars,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
   createCalendar(controller, CALENDARNAME);
 }
 
 function testTodayPane() {
   let createEvent = (hour, name) => {
     let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, hour);
     invokeEventDialog(controller, eventBox, (event, iframe) => {
       let { eid: eventid } = helpersForController(event);
--- a/calendar/test/mozmill/views/testDayView.js
+++ b/calendar/test/mozmill/views/testDayView.js
@@ -1,20 +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 MODULE_NAME = "testDayView";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var CALENDARNAME, CANVAS_BOX, EVENT_BOX, DAY_VIEW, LABELDAYBOX, EVENTPATH;
-var helpersForController, invokeEventDialog, getEventDetails, createCalendar;
+var helpersForController, switchToView, invokeEventDialog, getEventDetails, createCalendar;
 var closeAllEventDialogs, deleteCalendars, goToDate, lookupEventBox;
 var helpersForEditUI, setData;
 
 const TITLE1 = "Day View Event";
 const TITLE2 = "Day View Event Changed";
 const DESC = "Day View Event Description";
 
 function setupModule(module) {
@@ -22,36 +18,38 @@ function setupModule(module) {
   ({
     CALENDARNAME,
     CANVAS_BOX,
     EVENT_BOX,
     DAY_VIEW,
     LABELDAYBOX,
     EVENTPATH,
     helpersForController,
+    switchToView,
     invokeEventDialog,
     getEventDetails,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     goToDate,
     lookupEventBox,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ helpersForEditUI, setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
+  ({ helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
 
   createCalendar(controller, CALENDARNAME);
 }
 
 function testDayView() {
   let dateFormatter = cal.getDateFormatter();
 
+  switchToView(controller, "day");
   goToDate(controller, 2009, 1, 1);
 
   // Verify date in view.
   let day = lookup(`${DAY_VIEW}/${LABELDAYBOX}/{"flex":"1"}`);
   controller.waitFor(() => day.getNode().mDate.icalString == "20090101");
 
   // Create event at 8 AM.
   let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, 8);
--- a/calendar/test/mozmill/views/testMonthView.js
+++ b/calendar/test/mozmill/views/testMonthView.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testMonthView";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var CALENDARNAME, CANVAS_BOX, MONTH_VIEW, EVENTPATH;
 var helpersForController, switchToView, invokeEventDialog, getEventDetails, createCalendar;
 var closeAllEventDialogs, deleteCalendars, goToDate, lookupEventBox;
 var helpersForEditUI, setData;
 
 const TITLE1 = "Month View Event";
@@ -28,23 +24,22 @@ function setupModule(module) {
     switchToView,
     invokeEventDialog,
     getEventDetails,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     goToDate,
     lookupEventBox,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ helpersForEditUI, setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
   createCalendar(controller, CALENDARNAME);
 }
 
 function testMonthView() {
   let dateFormatter = cal.getDateFormatter();
 
   switchToView(controller, "month");
   goToDate(controller, 2009, 1, 1);
--- a/calendar/test/mozmill/views/testMultiweekView.js
+++ b/calendar/test/mozmill/views/testMultiweekView.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testMultiweekView";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var CALENDARNAME, CANVAS_BOX, MULTIWEEK_VIEW, EVENTPATH;
 var helpersForController, switchToView, invokeEventDialog, getEventDetails, createCalendar;
 var closeAllEventDialogs, deleteCalendars, goToDate, lookupEventBox;
 var helpersForEditUI, setData;
 
 const TITLE1 = "Multiweek View Event";
@@ -28,23 +24,22 @@ function setupModule(module) {
     switchToView,
     invokeEventDialog,
     getEventDetails,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     goToDate,
     lookupEventBox,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ helpersForEditUI, setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
   createCalendar(controller, CALENDARNAME);
 }
 
 function testMultiWeekView() {
   let dateFormatter = cal.getDateFormatter();
 
   switchToView(controller, "multiweek");
   goToDate(controller, 2009, 1, 1);
--- a/calendar/test/mozmill/views/testTaskView.js
+++ b/calendar/test/mozmill/views/testTaskView.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testTaskView";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils"];
-
 var CALENDARNAME, CALENDARLIST, TASK_VIEW;
 var helpersForController, invokeEventDialog, createCalendar, closeAllEventDialogs, deleteCalendars;
 var setData;
 
 const TITLE = "Task";
 const DESCRIPTION = "1. Do A\n2. Do B";
 const PERCENTCOMPLETE = "50";
 var CALENDARID;
@@ -21,23 +17,20 @@ function setupModule(module) {
     CALENDARNAME,
     CALENDARLIST,
     TASK_VIEW,
     helpersForController,
     invokeEventDialog,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ setData } = ChromeUtils.import("resource://testing-common/mozmill/ItemEditingHelpers.jsm"));
   CALENDARID = createCalendar(controller, CALENDARNAME);
 }
 
 // Mozmill doesn't support trees yet, therefore completed checkbox and line-through style are not
 // checked.
 function testTaskView() {
   // paths
   let treeChildren = `${TASK_VIEW}/[1]/id("calendar-task-tree")/{"class":"calendar-task-treechildren"}`;
@@ -148,14 +141,17 @@ function testTaskView() {
   sleep();
 
   toolTipNode.ownerGlobal.showToolTip(toolTipNode, taskTreeNode.getTaskAtRow(0));
   controller.assertJSProperty(toolTipStatus, "textContent", "Completed");
 
   // Delete task and verify.
   controller.click(eid("calendar-delete-task-button"));
   controller.waitFor(() => taskTreeNode.mTaskArray.length == 0, "Task did not delete");
+
+  let tabmail = controller.window.document.getElementById("tabmail");
+  tabmail.closeTab(tabmail.currentTabInfo);
 }
 
 function teardownModule(module) {
   deleteCalendars(controller, CALENDARNAME);
   closeAllEventDialogs();
 }
--- a/calendar/test/mozmill/views/testWeekView.js
+++ b/calendar/test/mozmill/views/testWeekView.js
@@ -1,16 +1,12 @@
 /* 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 MODULE_NAME = "testWeekView";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["calendar-utils", "item-editing-helpers"];
-
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
 
 var CALENDARNAME, CANVAS_BOX, EVENT_BOX, WEEK_VIEW, EVENTPATH;
 var helpersForController, switchToView, invokeEventDialog, getEventDetails, createCalendar;
 var closeAllEventDialogs, deleteCalendars, goToDate, lookupEventBox;
 var helpersForEditUI, setData;
 
 var TITLE1 = "Week View Event";
@@ -29,23 +25,22 @@ function setupModule(module) {
     switchToView,
     invokeEventDialog,
     getEventDetails,
     createCalendar,
     closeAllEventDialogs,
     deleteCalendars,
     goToDate,
     lookupEventBox,
-  } = collector.getModule("calendar-utils"));
-  collector.getModule("calendar-utils").setupModule(controller);
+  } = ChromeUtils.import("resource://testing-common/mozmill/CalendarUtils.jsm"));
   Object.assign(module, helpersForController(controller));
 
-  ({ helpersForEditUI, setData } = collector.getModule("item-editing-helpers"));
-  collector.getModule("item-editing-helpers").setupModule(module);
-
+  ({ helpersForEditUI, setData } = ChromeUtils.import(
+    "resource://testing-common/mozmill/ItemEditingHelpers.jsm"
+  ));
   createCalendar(controller, CALENDARNAME);
 }
 
 function testWeekView() {
   let dateFormatter = cal.getDateFormatter();
 
   switchToView(controller, "week");
   goToDate(controller, 2009, 1, 1);
--- a/mail/test/mozmill/account/test-ab-whitelist.js
+++ b/mail/test/mozmill/account/test-ab-whitelist.js
@@ -1,42 +1,51 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-ab-whitelist";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var mozmill = ChromeUtils.import(
   "chrome://mozmill/content/modules/mozmill.jsm"
 );
 var controller = ChromeUtils.import(
   "chrome://mozmill/content/modules/controller.jsm"
 );
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_true,
+  FAKE_SERVER_HOSTNAME,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 var gOldWhiteList = null;
 var gKeyString = null;
 
 var gAccount = null;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let amh = collector.getModule("account-manager-helpers");
-  amh.installInto(module);
-
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   gAccount = MailServices.accounts.FindAccountForServer(server);
   let serverKey = server.key;
 
--- a/mail/test/mozmill/account/test-account-actions.js
+++ b/mail/test/mozmill/account/test-account-actions.js
@@ -1,27 +1,39 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_not_equals,
+  assert_true,
+  close_popup,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-account-actions";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var imapAccount, nntpAccount, originalAccountCount;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("account-manager-helpers").installInto(module);
-
   // There may be pre-existing accounts from other tests.
   originalAccountCount = MailServices.accounts.allServers.length;
   // There already should be a Local Folders account created.
   // It is needed for this test.
   assert_true(MailServices.accounts.localFoldersServer);
 
   // Create an IMAP server
   let imapServer = MailServices.accounts
--- a/mail/test/mozmill/account/test-account-deletion.js
+++ b/mail/test/mozmill/account/test-account-deletion.js
@@ -3,30 +3,30 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This test checks proper deletion of an account from the Account manager.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var { open_advanced_settings, remove_account } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_equals, assert_false, assert_true } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-account-deletion";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var gPopAccount, gImapAccount, gOriginalAccountCount;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // There may be pre-existing accounts from other tests.
   gOriginalAccountCount = MailServices.accounts.allServers.length;
 
   // Create a POP server
   let popServer = MailServices.accounts
     .createIncomingServer("nobody", "pop.foo.invalid", "pop3")
     .QueryInterface(Ci.nsIPop3IncomingServer);
 
--- a/mail/test/mozmill/account/test-account-port-setting.js
+++ b/mail/test/mozmill/account/test-account-port-setting.js
@@ -1,29 +1,36 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-account-port-setting";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { FAKE_SERVER_HOSTNAME, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value, delete_all_existing } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+
 var PORT_NUMBERS_TO_TEST = [
   "110", // The original port number. We don't input this though.
   "456", // Random port number.
   "995", // The SSL port number.
   "110", // Back to the original.
 ];
 
 var gTestNumber;
@@ -67,22 +74,16 @@ function subtest_check_set_port_number(a
     )
   );
 }
 
 function subtest_check_port_number(amc) {
   subtest_check_set_port_number(amc, true);
 }
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function test_account_port_setting() {
   for (
     gTestNumber = 1;
     gTestNumber < PORT_NUMBERS_TO_TEST.length;
     ++gTestNumber
   ) {
     open_advanced_settings(subtest_check_set_port_number);
   }
--- a/mail/test/mozmill/account/test-account-settings-infrastructure.js
+++ b/mail/test/mozmill/account/test-account-settings-infrastructure.js
@@ -7,33 +7,44 @@
  * in the Account manager. E.g. if the values of elements are properly stored when
  * panes are switched.
  *
  * New checks can be added to it as needed.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-account-settings-infrastructure";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_true,
+  FAKE_SERVER_HOSTNAME,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 var gPopAccount, gImapAccount, gOriginalAccountCount;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("account-manager-helpers").installInto(module);
-
   // There may be pre-existing accounts from other tests.
   gOriginalAccountCount = MailServices.accounts.allServers.length;
 
   // Create a POP server
   let popServer = MailServices.accounts
     .createIncomingServer("nobody", "pop.invalid", "pop3")
     .QueryInterface(Ci.nsIPop3IncomingServer);
 
--- a/mail/test/mozmill/account/test-account-tree.js
+++ b/mail/test/mozmill/account/test-account-tree.js
@@ -3,29 +3,35 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This test checks proper operation of the account tree in the Account manager.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+  remove_account,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_equals, assert_false, assert_true } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-account-tree";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var gPopAccount, gOriginalAccountCount;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("account-manager-helpers").installInto(module);
-
   // There may be pre-existing accounts from other tests.
   gOriginalAccountCount = MailServices.accounts.allServers.length;
 
   // Create a POP server
   let popServer = MailServices.accounts
     .createIncomingServer("nobody", "foo.invalid", "pop3")
     .QueryInterface(Ci.nsIPop3IncomingServer);
 
--- a/mail/test/mozmill/account/test-account-values.js
+++ b/mail/test/mozmill/account/test-account-values.js
@@ -4,41 +4,45 @@
 
 /**
  * This test checks proper operation of the account settings panes
  * when certain special or invalid values are entered into the fields.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-account-values";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_equals, assert_false } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value, delete_all_existing } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 var gPopAccount, gOriginalAccountCount;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // There may be pre-existing accounts from other tests.
   gOriginalAccountCount = MailServices.accounts.allServers.length;
 
   // Create a POP server
   let popServer = MailServices.accounts
     .createIncomingServer("nobody", "example.invalid", "pop3")
     .QueryInterface(Ci.nsIPop3IncomingServer);
 
--- a/mail/test/mozmill/account/test-archive-options.js
+++ b/mail/test/mozmill/account/test-archive-options.js
@@ -1,46 +1,49 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-archive-options";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var mozmill = ChromeUtils.import(
   "chrome://mozmill/content/modules/mozmill.jsm"
 );
 var controller = ChromeUtils.import(
   "chrome://mozmill/content/modules/controller.jsm"
 );
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
+var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
 var {
+  click_account_tree_row,
+  get_account_tree_row,
+  open_advanced_settings,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_equals, assert_false, assert_true, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
   plan_for_modal_dialog,
   plan_for_window_close,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+
 var defaultIdentity;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let amh = collector.getModule("account-manager-helpers");
-  amh.installInto(module);
-
   defaultIdentity = MailServices.accounts.defaultAccount.defaultIdentity;
 }
 
 /**
  * Check that the archive options button is enabled or disabled appropriately.
  *
  * @param amc          the account options controller
  * @param aAccountKey  key of the account the check
--- a/mail/test/mozmill/account/test-mail-account-setup-wizard.js
+++ b/mail/test/mozmill/account/test-mail-account-setup-wizard.js
@@ -1,25 +1,27 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-mail-account-setup-wizard";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  open_advanced_settings_from_account_wizard,
+  open_mail_account_setup_wizard,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_equals, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value, delete_all_existing } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
@@ -30,22 +32,16 @@ var { MailServices } = ChromeUtils.impor
 var user = {
   name: "Yamato Nadeshiko",
   email: "yamato.nadeshiko@example.com",
   password: "abc12345",
   incomingHost: "testin.example.com",
   outgoingHost: "testout.example.com",
 };
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 // Remove an account in the Account Manager, but not via the UI.
 function remove_account_internal(amc, aAccount, aOutgoing) {
   let win = amc.window;
 
   try {
     // Remove the account and incoming server
     let serverId = aAccount.incomingServer.serverURI;
     MailServices.accounts.removeAccount(aAccount);
--- a/mail/test/mozmill/account/test-retest-config.js
+++ b/mail/test/mozmill/account/test-retest-config.js
@@ -1,44 +1,40 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-retest-config";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "account-manager-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var { open_mail_account_setup_wizard } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
+var { assert_true, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value, delete_all_existing } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var user = {
   name: "test",
   email: "test@momo.invalid",
   altEmail: "test2@momo.invalid",
 };
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
   Services.prefs.setCharPref("mail.wizard.logging.dump", "All");
 
   let url = collector.addHttpResource("../account/xml", "accountconfig");
   Services.prefs.setCharPref("mailnews.auto_config_url", url);
   collector.httpd.registerContentType("invalid", "text/xml");
 }
 
 function tearDownModule(module) {
--- a/mail/test/mozmill/addrbook/test-address-book-panes.js
+++ b/mail/test/mozmill/addrbook/test-address-book-panes.js
@@ -3,44 +3,40 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests for the address book.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-address-book-panes";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
+var {
+  close_address_book_window,
+  open_address_book_window,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
 
 var abController;
 
 function setupModule(module) {
-  // We need this to get mc which is needed in open_address_book_window.
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let abh = collector.getModule("address-book-helpers");
-  abh.installInto(module);
-
   // Open the address book main window
   abController = open_address_book_window();
 }
 
 function teardownModule(module) {
   // Make sure the panes are all visible now that we're
   // done these tests.
   toggle_directory_pane();
   toggle_contact_pane();
 
   assert_directory_pane_visibility(true);
   assert_contact_pane_visibility(true);
+
+  close_address_book_window(abController);
 }
 
 /**
  * Helper function to toggle a pane.
  *
  * @param splitterId the id of the splitter to toggle
  */
 function _help_toggle_pane(splitterId) {
--- a/mail/test/mozmill/addrbook/test-address-book.js
+++ b/mail/test/mozmill/addrbook/test-address-book.js
@@ -3,28 +3,45 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests for the address book.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-address-book";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "address-book-helpers",
-  "compose-helpers",
-];
-
+var {
+  close_address_book_window,
+  create_address_book,
+  create_contact,
+  create_ldap_address_book,
+  create_mailing_list,
+  get_name_of_address_book_element_at,
+  is_address_book_collapsed,
+  load_contacts_into_address_book,
+  load_contacts_into_mailing_list,
+  open_address_book_window,
+  select_address_book,
+  select_contacts,
+  set_address_books_collapsed,
+  set_address_books_expanded,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var { wait_for_compose_window } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_true,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
 );
 var { plan_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { XPCOMUtils } = ChromeUtils.import(
@@ -35,20 +52,16 @@ var { MailServices } = ChromeUtils.impor
   "resource:///modules/MailServices.jsm"
 );
 
 var abController = null;
 var addrBook1, addrBook2, addrBook3, addrBook4, ldapBook;
 var mListA, mListB, mListC, mListD, mListE;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Open the address book main window
   abController = open_address_book_window();
 
   // Let's add some new address books.  I'll add them
   // out of order to properly test the alphabetical
   // ordering of the address books.
   ldapBook = create_ldap_address_book("LDAP Book");
   addrBook3 = create_address_book("AB 3");
@@ -74,16 +87,20 @@ function setupModule(module) {
   abController.waitFor(
     () => abController.window.gDirectoryTreeView.rowCount == 8,
     "Timeout waiting for all 8 rows in address books list to show up in the tree view",
     1000,
     10
   );
 }
 
+function teardownModule(module) {
+  close_address_book_window(abController);
+}
+
 /* Test that the address book manager automatically sorts
  * address books.
  *
  * Currently, we sort address books as follows:
  * 1. All Address Books
  * 2. Personal Address Book
  * 3. Mork Address Books
  * 4. LDAP / Other Address Books
--- a/mail/test/mozmill/addrbook/test-update-mailing-list.js
+++ b/mail/test/mozmill/addrbook/test-update-mailing-list.js
@@ -4,32 +4,38 @@
 
 /**
  * Tests that if a contact's address is updated, then the address is also
  * updated in mailing lists that that contact belongs to.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-update-mailing-list";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
+var {
+  accept_contact_changes,
+  close_address_book_window,
+  create_address_book,
+  create_contact,
+  create_mailing_list,
+  delete_address_book,
+  edit_selected_contact,
+  open_address_book_window,
+  select_address_book,
+  select_contacts,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var { assert_equals, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
-function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("address-book-helpers").installInto(module);
-}
-
 function test_contact_in_mailing_list_updated() {
   const kOldAddress = "before@example.com";
   const kNewAddress = "after@example.com";
 
   // Create some address book to work with...
   let ab = create_address_book("Some Address Book");
   // And a contact...
   let contact = create_contact(kOldAddress, "Some Contact", true);
@@ -64,9 +70,11 @@ function test_contact_in_mailing_list_up
     ml.addressLists.length,
     "There should only be one contact in the mailing list"
   );
   let mlContact = ml.addressLists.queryElementAt(0, Ci.nsIAbCard);
   assert_equals(kNewAddress, mlContact.primaryEmail);
 
   // Destroy the address book that we created.
   delete_address_book(ab);
+
+  close_address_book_window(abw);
 }
--- a/mail/test/mozmill/attachment/test-attachment-events.js
+++ b/mail/test/mozmill/attachment/test-attachment-events.js
@@ -3,48 +3,45 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Ensures that attachment events are fired properly
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment-events";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 var { select_attachments } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var { assert_equals, assert_true, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
+  add_attachments,
+  close_compose_window,
+  open_compose_new_mail,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { fixIterator } = ChromeUtils.import(
   "resource:///modules/iteratorUtils.jsm"
 );
 
 var kAttachmentsAdded = "attachments-added";
 var kAttachmentsRemoved = "attachments-removed";
 var kAttachmentRenamed = "attachment-renamed";
 
 var gPath;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gPath = os.getFileForPath(__file__);
 }
 
 /**
  * Test that the attachments-added event is fired when we add a single
  * attachment.
  */
 function test_attachments_added_on_single() {
--- a/mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
+++ b/mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
@@ -1,32 +1,32 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-dom-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment-in-plain-msg";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "dom-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { wait_for_element_visible } = ChromeUtils.import(
+  "resource://testing-common/mozmill/DOMHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_true,
+  open_message_from_file,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
  * Bug 1358565
  * Check that a non-empty image is shown as attachment and is detected as non-empty
  * when message is viewed as plain text.
  */
 async function test_attachment_not_empty() {
   Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", true);
--- a/mail/test/mozmill/attachment/test-attachment-menus.js
+++ b/mail/test/mozmill/attachment/test-attachment-menus.js
@@ -1,20 +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/. */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment-menus";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var folder;
 var messenger;
 var epsilon;
 
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
@@ -25,16 +19,28 @@ var controller = ChromeUtils.import(
 var {
   create_body_part,
   create_deleted_attachment,
   create_detached_attachment,
   create_enclosure_attachment,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var {
+  add_message_to_folder,
+  be_in_folder,
+  close_popup,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var textAttachment =
   "Can't make the frug contest, Helen; stomach's upset. I'll fix you, " +
   "Ubik! Ubik drops you back in the thick of things fast. Taken as " +
   "directed, Ubik speeds relief to head and stomach. Remember: Ubik is " +
   "only seconds away. Avoid prolonged use.";
 
 var detachedName = "./attachment.txt";
@@ -173,19 +179,16 @@ var messages = [
       { open: false, save: false, detach: false, delete_: false },
       { open: false, save: false, detach: false, delete_: false },
     ],
     allMenuStates: { open: false, save: false, detach: false, delete_: false },
   },
 ];
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
 
   /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
    * counts the trailing newline for an attachment MIME part. Most of the time,
    * assuming attachment has N bytes (no matter what's inside, newlines or
    * not), libmime will return N + 1 bytes. On Linux and Mac, this always
    * holds. However, on Windows, if the attachment is not encoded (that is, is
    * inline text), libmime will return N + 2 bytes.
--- a/mail/test/mozmill/attachment/test-attachment-size.js
+++ b/mail/test/mozmill/attachment/test-attachment-size.js
@@ -1,36 +1,43 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment-size";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var folder;
 var messenger;
 var epsilon;
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var controller = ChromeUtils.import(
   "chrome://mozmill/content/modules/controller.jsm"
 );
 
 var {
   create_body_part,
   create_deleted_attachment,
   create_detached_attachment,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var {
+  add_message_to_folder,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  msgGen,
+  select_click_row,
+  SyntheticPartLeaf,
+  SyntheticPartMultiMixed,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var textAttachment =
   "Can't make the frug contest, Helen; stomach's upset. I'll fix you, " +
   "Ubik! Ubik drops you back in the thick of things fast. Taken as " +
   "directed, Ubik speeds relief to head and stomach. Remember: Ubik is " +
   "only seconds away. Avoid prolonged use.";
 
 var binaryAttachment = textAttachment;
@@ -164,20 +171,16 @@ var messages = [
     name: "attached_message_with_attachment",
     bodyPart: null,
     attachmentSizes: [-1, textAttachment.length],
     attachmentTotalSize: { size: 0, exact: true },
   },
 ];
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
 
   /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
    * counts the trailing newline for an attachment MIME part. Most of the time,
    * assuming attachment has N bytes (no matter what's inside, newlines or
    * not), libmime will return N + 1 bytes. On Linux and Mac, this always
    * holds. However, on Windows, if the attachment is not encoded (that is, is
    * inline text), libmime will return N + 2 bytes.
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -3,30 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Checks various attachments display correctly
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var EventUtils = ChromeUtils.import(
   "chrome://mozmill/content/stdlib/EventUtils.jsm"
 );
 
+var { close_compose_window, open_compose_with_forward } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  add_message_to_folder,
+  assert_attachment_list_focused,
+  assert_equals,
+  assert_message_pane_focused,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  close_popup,
+  create_folder,
+  create_message,
+  mc,
+  msgGen,
+  plan_to_wait_for_folder_events,
+  select_click_row,
+  select_none,
+  SyntheticPartLeaf,
+  SyntheticPartMultiMixed,
+  wait_for_folder_events,
+  wait_for_message_display_completion,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   close_window,
   plan_for_modal_dialog,
   plan_for_new_window,
   wait_for_modal_dialog,
   wait_for_new_window,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
@@ -42,20 +62,16 @@ var textAttachment =
   "that happens someone like myself who has gone through an ordeal and who " +
   "genuinely needs hot coffee to pick him up and keep him functioning when " +
   "he has to function will get the hot coffee whether he happens to have a " +
   "poscred readily available or not.";
 
 var binaryAttachment = textAttachment;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folder = create_folder("AttachmentA");
 
   var attachedMessage = msgGen.makeMessage({
     body: { body: "I'm an attached email!" },
     attachments: [
       { body: textAttachment, filename: "inner attachment.txt", format: "" },
     ],
   });
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
@@ -3,47 +3,47 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests Filelink attachment item behaviour.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
-
-var MODULE_NAME = "test-cloudfile-attachment-item";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "cloudfile-helpers",
-];
-
 var {
   gMockFilePicker,
   gMockFilePickReg,
   select_attachments,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var {
+  collectFiles,
+  getFile,
+  gMockCloudfileManager,
+  MockCloudfileAccount,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
+);
+var {
+  add_cloud_attachments,
+  close_compose_window,
+  open_compose_new_mail,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var { assert_false, close_popup } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var kAttachmentItemContextID = "msgComposeAttachmentItemContext";
 
 var { cloudFileAccounts } = ChromeUtils.import(
   "resource:///modules/cloudFileAccounts.jsm"
 );
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gMockFilePickReg.register();
   gMockCloudfileManager.register();
 }
 
 function teardownModule(module) {
   gMockCloudfileManager.unregister();
   gMockFilePickReg.unregister();
 }
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
@@ -3,37 +3,59 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests Filelink URL insertion behaviours in compose windows.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
-/* import-globals-from ../shared-modules/test-dom-helpers.js */
-
-var MODULE_NAME = "test-cloudfile-attachment-urls";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "cloudfile-helpers",
-  "dom-helpers",
-];
-
 var {
   gMockFilePicker,
   gMockFilePickReg,
   select_attachments,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var {
+  collectFiles,
+  gMockCloudfileManager,
+  MockCloudfileAccount,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
+);
+var {
+  add_cloud_attachments,
+  assert_previous_text,
+  get_compose_body,
+  open_compose_new_mail,
+  open_compose_with_forward,
+  open_compose_with_reply,
+  type_in_composer,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_next_nodes,
+  assert_previous_nodes,
+  wait_for_element,
+} = ChromeUtils.import("resource://testing-common/mozmill/DOMHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_equals,
+  assert_not_equals,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  create_message,
+  FAKE_SERVER_HOSTNAME,
+  get_special_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
@@ -50,20 +72,16 @@ var kSigOnForwardKey = "mail.identity.de
 var kDefaultSigKey = "mail.identity.id1.htmlSigText";
 var kDefaultSig = "This is my signature.\n\nCheck out my website sometime!";
 var kFiles = ["./data/testFile1", "./data/testFile2"];
 var kLines = ["This is a line of text", "and here's another!"];
 
 var gInbox, gOldHtmlPref, gOldSigPref;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // For replies and forwards, we'll work off a message in the Inbox folder
   // of the fake "tinderbox" account.
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   gInbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
--- a/mail/test/mozmill/cloudfile/test-cloudfile-manager.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-manager.js
@@ -4,45 +4,39 @@
 
 /**
  * Tests the richlistbox in the manager for attachment storage
  * services
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-pref-window-helpers.js */
-
-var MODULE_NAME = "test-cloudfile-manager";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "pref-window-helpers",
-  "content-tab-helpers",
-  "cloudfile-helpers",
-];
-
+var { gMockCloudfileManager } = ChromeUtils.import(
+  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
+);
+var { content_tab_e, gMockExtProtSvc, gMockExtProtSvcReg } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { assert_equals, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var { close_pref_tab, open_pref_tab } = ChromeUtils.import(
+  "resource://testing-common/mozmill/PrefTabHelpers.jsm"
+);
 var { wait_for_frame_load } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var kTestAccountType = "mock";
 var kRootURL = collector.addHttpResource("../cloudfile/html", "");
 var kSettingsWithLink = kRootURL + "settings-with-link.xhtml";
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gMockCloudfileManager.register(kTestAccountType, {
     managementURL: kSettingsWithLink,
   });
 
   // Let's set up a few dummy accounts;
   create_dummy_account("someKey1", kTestAccountType, "carl's Account");
   create_dummy_account("someKey2", kTestAccountType, "Amber's Account");
   create_dummy_account("someKey3", kTestAccountType, "alice's Account");
--- a/mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
@@ -3,36 +3,40 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that the cloudfile notifications work as they should.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
-
-var MODULE_NAME = "test-cloudfile-notifications";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "cloudfile-helpers",
-];
-
 var {
   gMockFilePicker,
   gMockFilePickReg,
   select_attachments,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
 var {
+  collectFiles,
+  gMockCloudfileManager,
+  MockCloudfileAccount,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
+);
+var {
+  add_attachments,
+  add_cloud_attachments,
+  close_compose_window,
+  open_compose_new_mail,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var { mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
   assert_notification_displayed,
   close_notification,
   wait_for_notification_to_stop,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
 );
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
@@ -47,20 +51,16 @@ var maxSize, oldInsertNotificationPref;
 
 var kOfferThreshold = "mail.compose.big_attachments.threshold_kb";
 var kInsertNotificationPref =
   "mail.compose.big_attachments.insert_notification";
 
 var kBoxId = "compose-notification-bottom";
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gMockCloudfileManager.register();
   gMockFilePickReg.register();
 
   maxSize = Services.prefs.getIntPref(kOfferThreshold, 0) * 1024;
   oldInsertNotificationPref = Services.prefs.getBoolPref(
     kInsertNotificationPref
   );
   Services.prefs.setBoolPref(kInsertNotificationPref, true);
--- a/mail/test/mozmill/composition/test-address-widgets.js
+++ b/mail/test/mozmill/composition/test-address-widgets.js
@@ -3,37 +3,43 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests proper enabling of addressing widgets.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-address-widgets";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
+var { close_compose_window, open_compose_new_mail } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_true,
+  be_in_folder,
+  FAKE_SERVER_HOSTNAME,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { fixIterator } = ChromeUtils.import(
   "resource:///modules/iteratorUtils.jsm"
 );
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var cwc = null; // compose window controller
 var accountPOP3 = null;
 var accountNNTP = null;
 var originalAccountCount;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   accountPOP3 = MailServices.accounts.FindAccountForServer(server);
--- a/mail/test/mozmill/composition/test-attachment-reminder.js
+++ b/mail/test/mozmill/composition/test-attachment-reminder.js
@@ -3,23 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that the attachment reminder works properly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment-reminder";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var {
+  add_attachments,
+  close_compose_window,
+  open_compose_new_mail,
+  setup_msg_contents,
+  wait_for_compose_window,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { delete_all_existing } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var {
   assert_notification_displayed,
   check_notification_displayed,
   get_notification_button,
   wait_for_notification_to_show,
@@ -44,20 +55,16 @@ var { MailServices } = ChromeUtils.impor
 
 var kBoxId = "compose-notification-bottom";
 var kNotificationId = "attachmentReminder";
 var kReminderPref = "mail.compose.attachment_reminder";
 var gDrafts;
 var gOutbox;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
   gOutbox = get_special_folder(Ci.nsMsgFolderFlags.Queue);
 
   assert_true(Services.prefs.getBoolPref(kReminderPref));
 }
 
 /**
  * Check if the attachment reminder bar is in the wished state.
--- a/mail/test/mozmill/composition/test-attachment.js
+++ b/mail/test/mozmill/composition/test-attachment.js
@@ -3,35 +3,49 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests attachment handling functionality of the message compose window.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-attachment";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  add_attachments,
+  close_compose_window,
+  delete_attachment,
+  open_compose_new_mail,
+  open_compose_with_forward,
+  open_compose_with_forward_as_attachments,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_equals,
+  be_in_folder,
+  create_folder,
+  create_message,
+  select_click_row,
+
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { AppConstants } = ChromeUtils.import(
   "resource://gre/modules/AppConstants.jsm"
 );
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var messenger;
 var folder;
 var epsilon;
 var isWindows;
 var filePrefix;
 
 var rawAttachment =
@@ -43,20 +57,16 @@ var rawAttachment =
 var b64Attachment =
   "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS" +
   "FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA" +
   "A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe" +
   "SNQAAlmAY+71EgFoAAAAASUVORK5CYII=";
 var b64Size = 188;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folder = create_folder("ComposeAttachmentA");
 
   messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
 
   isWindows = "@mozilla.org/windows-registry-key;1" in Cc;
 
   /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
    * counts the trailing newline for an attachment MIME part. Most of the time,
--- a/mail/test/mozmill/composition/test-base64-display.js
+++ b/mail/test/mozmill/composition/test-base64-display.js
@@ -3,34 +3,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that messages with "broken" base64 are correctly displayed.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-base64-display.js";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { assert_true, open_message_from_file } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function test_base64_display() {
   let file = os.getFileForPath(
     os.abspath("./base64-with-whitespace.eml", os.getFileForPath(__file__))
   );
   let msgc = open_message_from_file(file);
   let bodyText = msgc.e("messagepane").contentDocument.querySelector("body")
     .textContent;
   close_window(msgc);
--- a/mail/test/mozmill/composition/test-blocked-content.js
+++ b/mail/test/mozmill/composition/test-blocked-content.js
@@ -3,25 +3,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that we do the right thing wrt. blocked resources during composition.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-blocked-content";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  get_msg_source,
+  open_compose_new_mail,
+  setup_msg_contents,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_false,
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { wait_for_notification_to_show } = ChromeUtils.import(
   "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
 );
 var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
@@ -31,19 +39,16 @@ var { MailServices } = ChromeUtils.impor
 var { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 var gOutboxFolder;
 
 var kBoxId = "compose-notification-bottom";
 var kNotificationId = "blockedContent";
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
   gOutboxFolder = get_special_folder(Ci.nsMsgFolderFlags.Queue);
 }
 
 function putHTMLOnClipboard(html) {
   let trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(
     Ci.nsITransferable
   );
 
--- a/mail/test/mozmill/composition/test-charset-edit.js
+++ b/mail/test/mozmill/composition/test-charset-edit.js
@@ -4,49 +4,57 @@
 
 /**
  * Tests that we do the right thing wrt. message encoding when editing or
  * replying to messages.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-charset-edit";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
+var {
+  close_compose_window,
+  open_compose_with_reply,
+  wait_for_compose_window,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_equals,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_message,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+  SyntheticPartLeaf,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { wait_for_notification_to_show } = ChromeUtils.import(
   "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
 );
 var { plan_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 var { MimeParser } = ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 var gDrafts;
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
-
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 
   // Ensure reply charset isn't UTF-8, otherwise there's no need to upgrade,
   // which is what this test tests.
   let str = Cc["@mozilla.org/pref-localizedstring;1"].createInstance(
     Ci.nsIPrefLocalizedString
   );
   str.data = "windows-1252";
--- a/mail/test/mozmill/composition/test-charset-upgrade.js
+++ b/mail/test/mozmill/composition/test-charset-upgrade.js
@@ -4,39 +4,45 @@
 
 /**
  * Tests that we do the right thing wrt. message encoding, especially when
  * all characters doesn't fit the selected charset.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-charset-upgrade";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var {
+  get_msg_source,
+  open_compose_new_mail,
+  setup_msg_contents,
+  type_in_composer,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var gDrafts;
 var gOutbox;
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
   gOutbox = get_special_folder(Ci.nsMsgFolderFlags.Queue);
 
   // Ensure reply charset isn't UTF-8, otherwise there's no need to upgrade,
   //  which is what this test tests.
   let str = Cc["@mozilla.org/pref-localizedstring;1"].createInstance(
     Ci.nsIPrefLocalizedString
   );
--- a/mail/test/mozmill/composition/test-cp932-display.js
+++ b/mail/test/mozmill/composition/test-cp932-display.js
@@ -3,34 +3,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that messages in cp932, Thunderbirds alias for Shift_JIS, are correctly displayed.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-cp932-display.js";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { assert_true, open_message_from_file } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function test_cp932_display() {
   let file = os.getFileForPath(
     os.abspath("./charset-cp932.eml", os.getFileForPath(__file__))
   );
   let msgc = open_message_from_file(file);
   let subjectText = msgc.e("expandedsubjectBox").textContent;
   let bodyText = msgc.e("messagepane").contentDocument.querySelector("body")
     .textContent;
--- a/mail/test/mozmill/composition/test-draft-identity.js
+++ b/mail/test/mozmill/composition/test-draft-identity.js
@@ -4,23 +4,29 @@
 
 /**
  * Tests that compose new message chooses the correct initial identity when
  * called from the context of an open composer.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-draft-identity";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var { close_compose_window, open_compose_from_draft } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_equals,
+  be_in_folder,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   assert_notification_displayed,
   wait_for_notification_to_show,
 } = ChromeUtils.import(
   "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
 );
 
 var { MailServices } = ChromeUtils.import(
@@ -36,20 +42,16 @@ var gIdentities = [
   { email: "y@example.invalid", fullname: "User Y" },
   { email: "y@example.invalid", fullname: "User YY", label: "YY" },
   { email: "y+y@example.invalid", fullname: "User Y" },
   { email: "z@example.invalid", fullname: "User Z", label: "Label Z" },
   { email: "a+b@example.invalid", fullname: "User A" },
 ];
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Now set up an account with some identities.
   let acctMgr = MailServices.accounts;
   gAccount = acctMgr.createAccount();
   gAccount.incomingServer = acctMgr.createIncomingServer(
     "nobody",
     "Draft Identity Testing",
     "pop3"
   );
@@ -225,17 +227,17 @@ function test_draft_identity_selection()
     },
   ];
 
   for (let test of tests) {
     test.draftIndex = create_draft(test.draftFrom, test.draftIdKey);
   }
 
   for (let test of tests) {
-    dump("Running draft identity test" + tests.indexOf(test));
+    dump("Running draft identity test" + tests.indexOf(test) + "\n");
     be_in_folder(gDrafts);
     select_click_row(test.draftIndex);
 
     let cwc = open_compose_from_draft();
     checkCompIdentity(
       cwc,
       gIdentities[test.idIndex].key,
       test.from ? test.from : test.draftFrom
--- a/mail/test/mozmill/composition/test-drafts.js
+++ b/mail/test/mozmill/composition/test-drafts.js
@@ -4,43 +4,54 @@
 
 /**
  * Tests draft related functionality:
  * - that we don't allow opening multiple copies of a draft.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
-var MODULE_NAME = "test-drafts";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var {
+  close_compose_window,
+  get_compose_body,
+  get_msg_source,
+  open_compose_new_mail,
+  setup_msg_contents,
+  wait_for_compose_window,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  make_new_sets_in_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { wait_for_notification_to_show } = ChromeUtils.import(
   "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
 );
 var { plan_for_new_window, wait_for_window_focused } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var kBoxId = "mail-notification-top";
 var draftsFolder;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   draftsFolder = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 }
 
 /**
  * Bug 349547.
  * Tests that we only open one compose window for one instance of a draft.
  */
 function test_open_draft_again() {
--- a/mail/test/mozmill/composition/test-eml-actions.js
+++ b/mail/test/mozmill/composition/test-eml-actions.js
@@ -3,43 +3,48 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that actions such as replying to an .eml works properly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-eml-actions";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  get_compose_body,
+  open_compose_with_forward,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  be_in_folder,
+  get_special_folder,
+  open_message_from_file,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var gDrafts;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 }
 
 /**
  * Test that replying to an opened .eml message works, and that the reply can
  * be saved as a draft.
  */
 function test_reply_to_eml_save_as_draft() {
--- a/mail/test/mozmill/composition/test-focus.js
+++ b/mail/test/mozmill/composition/test-focus.js
@@ -3,28 +3,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that cycling through the focus of the 3pane's panes works correctly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-focus";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
+var {
+  add_attachments,
+  close_compose_window,
+  open_compose_new_mail,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var { assert_equals, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 /**
  * Check that it's possible to cycle through the compose window's important
  * elements forward and backward.
  *
  * @param controller the compose window controller
  * @param attachmentsExpanded true if the attachment pane is expanded
  * @param ctrlTab true if we should use Ctrl+Tab to cycle, false if we should
--- a/mail/test/mozmill/composition/test-forward-headers.js
+++ b/mail/test/mozmill/composition/test-forward-headers.js
@@ -4,23 +4,37 @@
 
 /**
  * Tests that headers like References and X-Forwarded-Message-Id are
  * set properly when forwarding messages.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-forward-headers";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var {
+  assert_previous_text,
+  get_compose_body,
+  open_compose_with_forward,
+  open_compose_with_forward_as_attachments,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_sets_to_folders,
+  assert_equals,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  create_thread,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+  select_shift_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { to_mime_message } = ChromeUtils.import(
   "resource://testing-common/mozmill/MessageHelpers.jsm"
 );
 var {
   plan_for_modal_dialog,
   plan_for_window_close,
   wait_for_modal_dialog,
   wait_for_window_close,
@@ -28,21 +42,16 @@ var {
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var cwc = null; // compose window controller
 var folder;
 var gDrafts;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
-
   folder = create_folder("Test");
   let thread1 = create_thread(10);
   add_sets_to_folders([folder], [thread1]);
 
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 
   // Don't create paragraphs in the test.
   // The test checks for the first DOM node and expects a text and not
--- a/mail/test/mozmill/composition/test-forward-rfc822-attach.js
+++ b/mail/test/mozmill/composition/test-forward-rfc822-attach.js
@@ -4,41 +4,46 @@
 
 /**
  * Tests that attached messages (message/rfc822) are correctly sent.
  * It's easiest to test the forward case.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-forward-rfc822-attach";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  get_msg_source,
+  open_compose_with_forward_as_attachments,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  mc,
+  open_message_from_file,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var gDrafts;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 }
 
 function forwardDirect(aFilePath, aExpectedText) {
   let file = os.getFileForPath(
     os.abspath(aFilePath, os.getFileForPath(__file__))
   );
   let msgc = open_message_from_file(file);
--- a/mail/test/mozmill/composition/test-forward-utf8.js
+++ b/mail/test/mozmill/composition/test-forward-utf8.js
@@ -3,44 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that UTF-8 messages are correctly forwarded.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-forward-utf8";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  get_compose_body,
+  open_compose_with_forward,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  mc,
+  open_message_from_file,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var folderToSendFrom;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folderToSendFrom = create_folder("FolderWithUTF8");
 }
 
 function check_content(window) {
   let mailBody = get_compose_body(window);
 
   let node = mailBody.firstChild;
   while (node) {
--- a/mail/test/mozmill/composition/test-forwarded-content.js
+++ b/mail/test/mozmill/composition/test-forwarded-content.js
@@ -3,30 +3,34 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that forwarded content is ok.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-forwarded-content";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
+var { close_compose_window, open_compose_with_forward } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  add_message_to_folder,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder = null;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folder = create_folder("Forward Content Testing");
   add_message_to_folder(
     folder,
     create_message({
       subject: "something like <foo@example>",
       body: { body: "Testing bug 397021!" },
     })
   );
--- a/mail/test/mozmill/composition/test-forwarded-eml-actions.js
+++ b/mail/test/mozmill/composition/test-forwarded-eml-actions.js
@@ -4,47 +4,52 @@
 
 /**
  * Tests that actions such as replying and forwarding works correctly from
  * an .eml message that's attached to another mail.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-forwarded-eml-actions";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
 var {
+  close_compose_window,
+  get_compose_body,
+  wait_for_compose_window,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  mc,
+  select_click_row,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
   close_window,
   plan_for_new_window,
   wait_for_new_window,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var folder;
 
 var msgsubject = "mail client suggestions";
 var msgbodyA = "know of a good email client?";
 var msgbodyB = "hi, i think you may know of an email client to recommend?";
 
 var setupModule = function(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("compose-helpers").installInto(module);
-
   folder = create_folder("FwdedEmlTest");
 
   let source =
     "From - Mon Apr  16 22:55:33 2012\n" +
     "Date: Mon, 16 Apr 2012 22:55:33 +0300\n" +
     "From: Mr Example <example@invalid>\n" +
     "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120331 Thunderbird/14.0a1\n" +
     "MIME-Version: 1.0\n" +
--- a/mail/test/mozmill/composition/test-image-display.js
+++ b/mail/test/mozmill/composition/test-image-display.js
@@ -3,40 +3,48 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that we load and display embedded images in messages.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-image-display";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  close_compose_window,
+  open_compose_with_forward,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_false,
+  assert_not_equals,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  mc,
+  open_message_from_file,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var gImageFolder;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
   gImageFolder = create_folder("ImageFolder");
 }
 
 /**
  * Check dimensions of the embedded image and whether it could be loaded.
  */
 function check_image_size(aController, aImage, aSrcStart) {
   assert_not_equals(null, aImage);
--- a/mail/test/mozmill/composition/test-image-insertion-dialog.js
+++ b/mail/test/mozmill/composition/test-image-insertion-dialog.js
@@ -3,43 +3,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests the image insertion dialog functionality.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-image-insertion-dialog";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var { close_compose_window, open_compose_new_mail } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { assert_true } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var wh = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
-var fdh, ch;
-
-function setupModule(module) {
-  fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  ch = collector.getModule("compose-helpers");
-  ch.installInto(module);
-}
-
 function test_image_insertion_dialog_persist() {
   let cwc = open_compose_new_mail();
 
   // First focus on the editor element
   cwc.e("content-frame").focus();
 
   // Now open the image window
   wh.plan_for_modal_dialog("imageDlg", function insert_image(mwc) {
@@ -80,16 +70,17 @@ function test_image_insertion_dialog_per
       "We should persist the previously selected value"
     );
     // Accept the dialog
     mwc.window.document.documentElement.cancelDialog();
   });
   cwc.click(cwc.eid("insertImage"));
   wh.wait_for_modal_dialog();
   wh.wait_for_window_close();
+  cwc.sleep(500);
 
   // Get the inserted image, double-click it, make sure we switch to "no alt
   // text", despite the persisted value being "use alt text"
   let img = cwc.e("content-frame").contentDocument.querySelector("img");
   wh.plan_for_modal_dialog("imageDlg", function insert_image(mwc) {
     assert_true(
       mwc.window.document.getElementById("noAltTextRadio").selected,
       "We shouldn't use the persisted value because the insert image has no alt text"
--- a/mail/test/mozmill/composition/test-multipart-related.js
+++ b/mail/test/mozmill/composition/test-multipart-related.js
@@ -3,47 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that multipart/related messages are handled properly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-multipart-related";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
+var { close_compose_window, open_compose_new_mail } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_equals,
+  be_in_folder,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   plan_for_modal_dialog,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 var { MimeParser } = ChromeUtils.import("resource:///modules/mimeParser.jsm");
 
 var gDrafts;
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 }
 
 /**
  * Helper to get the full message content.
  *
  * @param aMsgHdr: nsIMsgDBHdr object whose text body will be read
  * @return {Map(partnum -> message headers), Map(partnum -> message text)}
--- a/mail/test/mozmill/composition/test-newmsg-compose-identity.js
+++ b/mail/test/mozmill/composition/test-newmsg-compose-identity.js
@@ -4,30 +4,39 @@
 
 /**
  * Tests that compose new message chooses the correct initial identity when
  * called from the context of an open composer.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-newmsg-compose-identity";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var {
+  close_compose_window,
+  open_compose_new_mail,
+  wait_for_compose_window,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  be_in_folder,
+  get_special_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gInbox;
 var gDrafts;
 var account;
 
 var identityKey1;
 var identity1Email = "x@example.invalid";
 var identityKey2;
@@ -36,20 +45,16 @@ var identity2Name = "User Y";
 var identity2From = identity2Name + " <" + identity2Email + ">";
 var identityKey3;
 var identity3Email = "z@example.invalid";
 var identity3Name = "User Z";
 var identity3Label = "Label Z";
 var identityKey4;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Now set up an account with some identities.
   let acctMgr = MailServices.accounts;
   account = acctMgr.createAccount();
   account.incomingServer = acctMgr.createIncomingServer(
     "nobody",
     "New Msg Compose Identity Testing",
     "pop3"
   );
--- a/mail/test/mozmill/composition/test-reply-addresses.js
+++ b/mail/test/mozmill/composition/test-reply-addresses.js
@@ -5,40 +5,48 @@
 /**
  * Tests that we get correct adressees for different type of replies:
  * reply to sender, reply to all, reply to list, mail-followup-tp,
  * mail-reply-to, and reply to self.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-reply-addresses";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
+var {
+  close_compose_window,
+  open_compose_with_reply,
+  open_compose_with_reply_to_all,
+  open_compose_with_reply_to_list,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_equals,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 var i = 0;
 
 var myEmail = "me@example.com";
 var myEmail2 = "otherme@example.com";
 
 var identity;
 var identity2;
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("compose-helpers").installInto(module);
-
   // Now set up an account with some identities.
   let acctMgr = MailServices.accounts;
   let account = acctMgr.createAccount();
   account.incomingServer = acctMgr.createIncomingServer(
     "nobody",
     "Reply Addresses Testing",
     "pop3"
   );
--- a/mail/test/mozmill/composition/test-reply-format-flowed.js
+++ b/mail/test/mozmill/composition/test-reply-format-flowed.js
@@ -3,41 +3,45 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that the reply to a format=flowed message is also flowed.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-reply-format-flowed";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  get_msg_source,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_true,
+  be_in_folder,
+  get_special_folder,
+  open_message_from_file,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var gDrafts;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 
   Services.prefs.setBoolPref("mail.identity.id1.compose_html", false);
 }
 
 function subtest_reply_format_flowed(aFlowed) {
   let file = os.getFileForPath(
     os.abspath("./format-flowed.eml", os.getFileForPath(__file__))
--- a/mail/test/mozmill/composition/test-reply-multipart-charset.js
+++ b/mail/test/mozmill/composition/test-reply-multipart-charset.js
@@ -17,39 +17,49 @@
  * Tests that the correct charset is used, even if the message
  * wasn't viewed before answering/forwarding.
  * For good measure some tests are included for charset overriding
  * and enforcing the charset default.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-reply-multipart-charset";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  open_compose_with_edit_as_new,
+  open_compose_with_forward,
+  open_compose_with_forward_as_attachments,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  mc,
+  open_message_from_file,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 var folderToStoreMessages;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folderToStoreMessages = create_folder("FolderWithMessages");
 }
 
 function subtest_replyEditAsNewForward_charset(
   aAction,
   aFile,
   aCharset,
   aOverride = null,
@@ -192,9 +202,11 @@ function test_replyEditAsNewForward_noPr
   );
   subtest_replyEditAsNewForward_charset(
     3,
     "./multipart-charset.eml",
     "EUC-KR",
     null,
     false
   );
+
+  mc.window.goDoCommand("cmd_toggleMessagePane");
 }
--- a/mail/test/mozmill/composition/test-reply-signature.js
+++ b/mail/test/mozmill/composition/test-reply-signature.js
@@ -3,33 +3,39 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests the mail.strip_sig_on_reply pref.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-reply-signature";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
+var {
+  close_compose_window,
+  get_compose_body,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var sig = "roses are red";
 var folder;
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
-
   folder = create_folder("SigStripTest");
 
   let msg = create_message({
     subject: "msg with signature; format=flowed",
     body: {
       body:
         "get with the flow! get with the flow! get with the flow! " +
         "get with the \n flow! get with the flow!\n-- \n" +
--- a/mail/test/mozmill/composition/test-save-changes-on-quit.js
+++ b/mail/test/mozmill/composition/test-save-changes-on-quit.js
@@ -5,41 +5,51 @@
 /**
  * Tests that we prompt the user if they'd like to save their message when they
  * try to quit/close with an open compose window with unsaved changes, and
  * that we don't prompt if there are no changes.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-save-changes-on-quit";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
-var SAVE = 0;
-var CANCEL = 1;
-var DONT_SAVE = 2;
-
+var {
+  close_compose_window,
+  open_compose_new_mail,
+  open_compose_with_forward,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  add_message_to_folder,
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
+var SAVE = 0;
+var CANCEL = 1;
+var DONT_SAVE = 2;
+
 var cwc = null; // compose window controller
 var folder = null;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folder = create_folder("PromptToSaveTest");
 
   add_message_to_folder(folder, create_message()); // row 0
   let localFolder = folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
   localFolder.addMessage(msgSource("content type: text", "text")); // row 1
   localFolder.addMessage(msgSource("content type missing", null)); // row 2
 }
 
--- a/mail/test/mozmill/composition/test-send-button.js
+++ b/mail/test/mozmill/composition/test-send-button.js
@@ -3,47 +3,60 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests proper enabling of send buttons depending on addresses input.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-send-button";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "address-book-helpers",
-];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
+var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
+var {
+  create_contact,
+  create_mailing_list,
+  load_contacts_into_address_book,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_true,
+  be_in_folder,
+  click_tree_row,
+  FAKE_SERVER_HOSTNAME,
+  get_special_folder,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
+  clear_recipient,
+  close_compose_window,
+  open_compose_new_mail,
+  setup_msg_contents,
+  toggle_recipient_type,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
 var { wait_for_frame_load } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { AppConstants } = ChromeUtils.import(
   "resource://gre/modules/AppConstants.jsm"
 );
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var account = null;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("compose-helpers").installInto(module);
-  collector.getModule("address-book-helpers").installInto(module);
-
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   account = MailServices.accounts.FindAccountForServer(server);
--- a/mail/test/mozmill/composition/test-send-format.js
+++ b/mail/test/mozmill/composition/test-send-format.js
@@ -4,35 +4,28 @@
 
 /**
  * Tests resulting send format of a message dependent on using HTML features
  * in the composition.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-send-format";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var { close_compose_window, open_compose_with_reply } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { assert_equals, open_message_from_file } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { close_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function checkMsgFile(aFilePath, aConvertibility) {
   let file = os.getFileForPath(
     os.abspath(aFilePath, os.getFileForPath(__file__))
   );
   let msgc = open_message_from_file(file);
 
   // Creating a reply should not affect convertibility.
   let cwc = open_compose_with_reply(msgc);
--- a/mail/test/mozmill/composition/test-signature-init.js
+++ b/mail/test/mozmill/composition/test-signature-init.js
@@ -4,35 +4,30 @@
 
 /**
  * Tests that the compose window initializes with the signature correctly
  * under various circumstances.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var { get_compose_body, open_compose_new_mail } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { assert_equals } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-signature-init";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["compose-helpers", "folder-display-helpers"];
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var kHtmlPref = "mail.identity.default.compose_html";
 var kReplyOnTopPref = "mail.identity.default.reply_on_top";
 var kReplyOnTop = 1;
 var kSigBottomPref = "mail.identity.default.sig_bottom";
 
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-  collector.getModule("compose-helpers").installInto(module);
-}
-
 /**
  * Regression test for bug 762413 - tests that when we're set to reply above,
  * with the signature below the reply, we initialize the compose window such
  * that there is a <br> node above the signature. This allows the user to
  * insert text before the signature.
  */
 function test_on_reply_above_signature_below_reply() {
   let origHtml = Services.prefs.getBoolPref(kHtmlPref);
--- a/mail/test/mozmill/composition/test-signature-updating.js
+++ b/mail/test/mozmill/composition/test-signature-updating.js
@@ -9,32 +9,38 @@
 // mail.identity.id1.htmlSigFormat = false
 // mail.identity.id1.htmlSigText   = "Tinderbox is soo 90ies"
 
 // mail.identity.id2.htmlSigFormat = true
 // mail.identity.id2.htmlSigText   = "Tinderboxpushlog is the new <b>hotness!</b>"
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  close_compose_window,
+  open_compose_new_mail,
+  setup_msg_contents,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var {
+  assert_equals,
+  be_in_folder,
+  FAKE_SERVER_HOSTNAME,
+  get_special_folder,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-signature-updating";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var cwc = null; // compose window controller
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   let inbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
--- a/mail/test/mozmill/content-policy/test-compose-mailto.js
+++ b/mail/test/mozmill/content-policy/test-compose-mailto.js
@@ -1,55 +1,42 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-compose-mailto";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "content-tab-helpers",
-];
-
+var composeHelper = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { content_tab_eid, open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var {
   plan_for_modal_dialog,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var folder = null;
-var composeHelper = null;
 var gMsgNo = 0;
 var gComposeWin;
 var gNewTab;
 var gPreCount;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../content-policy/html", "content");
 
-function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-}
-
 function test_openComposeFromMailToLink() {
   // Open a content tab with the mailto link in it.
   // To open a tab we're going to have to cheat and use tabmail so we can load
   // in the data of what we want.
   gPreCount = mc.tabmail.tabContainer.allTabs.length;
   gNewTab = open_content_tab_with_url(url + "mailtolink.html");
   gComposeWin = composeHelper.open_compose_with_element_click(
     content_tab_eid(gNewTab, "mailtolink")
--- a/mail/test/mozmill/content-policy/test-dns-prefetch.js
+++ b/mail/test/mozmill/content-policy/test-dns-prefetch.js
@@ -6,53 +6,52 @@
  * The purpose of this test is to ensure that dns prefetch is turned off in
  * the message pane and compose windows. It also checks that dns prefetch is
  * currently turned off in content tabs, although when bug 545407 is fixed, it
  * should be turned back on again.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-dns-prefetch";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "content-tab-helpers",
-];
+var composeHelper = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var {
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  be_in_folder,
+  close_message_window,
+  create_folder,
+  mc,
+  open_selected_message_in_new_window,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder = null;
-var composeHelper = null;
 var gMsgNo = 0;
 var gMsgHdr = null;
 
 // These two constants are used to build the message body.
 var msgBody =
   '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
   "<html>\n" +
   "<head>\n" +
   "\n" +
   '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
   "</head>\n" +
   '<body bgcolor="#ffffff" text="#000000">\n' +
   "dns prefetch test message\n" +
   "</body>\n</html>\n";
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-
   folder = create_folder("dnsPrefetch");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId =
     Cc["@mozilla.org/uuid-generator;1"]
       .getService(Ci.nsIUUIDGenerator)
       .generateUUID() + "@mozillamessaging.invalid";
--- a/mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
+++ b/mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
@@ -4,30 +4,34 @@
 
 /**
  * The purpose of this test is to ensure that remote content can't gain access
  * to messages by loading their URIs.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-exposed-in-content-tabs";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "content-tab-helpers",
-];
+var composeHelper = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var {
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder = null;
-var composeHelper = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../content-policy/html", "content");
 
 // These two constants are used to build the message body.
 var msgBody =
@@ -39,23 +43,16 @@ var msgBody =
   "</head>\n" +
   '<body bgcolor="#ffffff" text="#000000">\n' +
   '<img id="testelement" src="' +
   url +
   'pass.png"/>\n' +
   "</body>\n</html>\n";
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-
   folder = create_folder("exposedInContent");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId =
     Cc["@mozilla.org/uuid-generator;1"]
       .getService(Ci.nsIUUIDGenerator)
       .generateUUID() + "@mozillamessaging.invalid";
--- a/mail/test/mozmill/content-policy/test-general-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-general-content-policy.js
@@ -14,33 +14,47 @@
  * - Reply email compose window
  * - Forward email compose window
  * - Content tab
  * - Feed message
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-general-content-policy";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "content-tab-helpers",
-];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
+var {
+  close_compose_window,
+  open_compose_with_forward,
+  open_compose_with_reply,
+} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
+var { open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  close_message_window,
+  create_folder,
+  mc,
+  open_message_from_file,
+  open_selected_message,
+  plan_for_message_display,
+  select_click_row,
+  set_open_message_behavior,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var {
   get_notification_button,
   wait_for_notification_to_show,
   wait_for_notification_to_stop,
 } = ChromeUtils.import(
@@ -119,20 +133,16 @@ var msgBodyStart =
   "\n" +
   '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
   "</head>\n" +
   '<body bgcolor="#ffffff" text="#000000">\n';
 
 var msgBodyEnd = "</body>\n</html>\n";
 
 function setupModule(module) {
-  for (let dep of MODULE_REQUIRES) {
-    collector.getModule(dep).installInto(module);
-  }
-
   folder = create_folder("generalContentPolicy");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId =
     Cc["@mozilla.org/uuid-generator;1"]
       .getService(Ci.nsIUUIDGenerator)
       .generateUUID() + "@mozillamessaging.invalid";
--- a/mail/test/mozmill/content-policy/test-js-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-js-content-policy.js
@@ -6,33 +6,41 @@
  * Tests whether JavaScript in a local/remote message works.
  *
  * @note This assumes an existing local account, and will cause the Trash
  * folder of that account to be emptied multiple times.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  assert_equals,
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  mc,
+  open_selected_message_in_new_tab,
+  select_click_row,
+  select_none,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-js-content-policy";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder = null;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../content-policy/html", "content");
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   folder = create_folder("jsContentPolicy");
   Services.prefs.setBoolPref("javascript.enabled", true);
 }
 
 function teardownModule(module) {
   Services.prefs.clearUserPref("javascript.enabled");
 }
 
--- a/mail/test/mozmill/content-policy/test-plugins-policy.js
+++ b/mail/test/mozmill/content-policy/test-plugins-policy.js
@@ -4,36 +4,45 @@
 
 /**
  * Checks if plugins are enabled in messages correctly or not.
  * As of bug 1508942, plugins are no longer enabled in any context.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var composeHelper = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var { open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
 
-var MODULE_NAME = "test-plugins-policy";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "compose-helpers",
-  "content-tab-helpers",
-];
-
+var {
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  be_in_folder,
+  close_message_window,
+  create_folder,
+  mc,
+  open_selected_message,
+  select_click_row,
+  select_none,
+  set_open_message_behavior,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_new_window, wait_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder = null;
-var composeHelper = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../content-policy/html", "content");
 
 // These two constants are used to build the message body.
 var msgBody =
@@ -43,23 +52,16 @@ var msgBody =
   "\n" +
   '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
   "</head>\n" +
   '<body bgcolor="#ffffff" text="#000000">\n' +
   '<embed id="testelement" type="application/x-test" width="400" height="400" border="1"></embed>\n' +
   "</body>\n</html>\n";
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  composeHelper = collector.getModule("compose-helpers");
-  composeHelper.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-
   folder = create_folder("pluginPolicy");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId =
     Cc["@mozilla.org/uuid-generator;1"]
       .getService(Ci.nsIUUIDGenerator)
       .generateUUID() + "@mozillamessaging.invalid";
--- a/mail/test/mozmill/content-policy/test-view-source.js
+++ b/mail/test/mozmill/content-policy/test-view-source.js
@@ -3,41 +3,40 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Test that view-source content can be reloaded to change encoding.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-view-source";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
 var {
+  assert_true,
+  be_in_folder,
+  create_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
   close_window,
   plan_for_new_window,
   wait_for_new_window,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder = null;
 
 function setupModule(module) {
-  for (let dep of MODULE_REQUIRES) {
-    collector.getModule(dep).installInto(module);
-  }
-
   folder = create_folder("viewsource");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId =
     Cc["@mozilla.org/uuid-generator;1"]
       .getService(Ci.nsIUUIDGenerator)
       .generateUUID() + "@invalid";
--- a/mail/test/mozmill/content-tabs/test-about-support.js
+++ b/mail/test/mozmill/content-tabs/test-about-support.js
@@ -1,41 +1,52 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var { close_compose_window, wait_for_compose_window } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_content_tab_element_hidden,
+  assert_content_tab_element_visible,
+  assert_content_tab_text_absent,
+  assert_content_tab_text_present,
+  content_tab_e,
+  content_tab_eid,
+  get_content_tab_element_display,
+  get_element_by_text,
+  open_content_tab_with_click,
+  wait_for_content_tab_element_display,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
 
-var MODULE_NAME = "test-about-support";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "content-tab-helpers",
-  "compose-helpers",
-];
-
+var {
+  assert_equals,
+  assert_true,
+  close_tab,
+  mark_failure,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 // eslint-disable-next-line mozilla/reject-importGlobalProperties
 Cu.importGlobalProperties(["DOMParser"]);
 
 var warningText = new Map();
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // The wording of the warning message when private data is being exported
   // from the about:support page.
   let bundle = Services.strings.createBundle(
     "chrome://messenger/locale/aboutSupportMail.properties"
   );
   // In HTML the warning label and text comprise the textContent of a single element.
   warningText.set(
     "text/html",
--- a/mail/test/mozmill/content-tabs/test-addons-mgr.js
+++ b/mail/test/mozmill/content-tabs/test-addons-mgr.js
@@ -1,37 +1,30 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-addons-mgr";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var { content_tab_e, wait_for_content_tab_load } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { assert_true, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   plan_for_modal_dialog,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function test_open_addons_with_url() {
   mc.window.openAddonsMgr("addons://list/theme");
   mc.sleep(0);
 
   let tab = mc.tabmail.currentTabInfo;
   wait_for_content_tab_load(tab, "about:addons", 10000);
   assert_true(
     content_tab_e(tab, "category-theme").selected,
--- a/mail/test/mozmill/content-tabs/test-content-tab.js
+++ b/mail/test/mozmill/content-tabs/test-content-tab.js
@@ -1,55 +1,61 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-dom-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-content-tab";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "content-tab-helpers",
-  "dom-helpers",
-];
-
 var controller = ChromeUtils.import(
   "chrome://mozmill/content/modules/controller.jsm"
 );
+var elementslib = ChromeUtils.import(
+  "chrome://mozmill/content/modules/elementslib.jsm"
+);
+var EventUtils = ChromeUtils.import(
+  "chrome://mozmill/content/stdlib/EventUtils.jsm"
+);
 var mozmill = ChromeUtils.import(
   "chrome://mozmill/content/modules/mozmill.jsm"
 );
-var elementslib = ChromeUtils.import(
-  "chrome://mozmill/content/modules/elementslib.jsm"
+
+var {
+  assert_content_tab_has_favicon,
+  open_content_tab_with_url,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { assert_element_visible, assert_element_not_visible } = ChromeUtils.import(
+  "resource://testing-common/mozmill/DOMHelpers.jsm"
 );
 
+var {
+  assert_equals,
+  assert_not_equals,
+  assert_tab_has_title,
+  assert_true,
+  close_popup,
+  mc,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 // Note: this one adds to '' as we need to make sure that favicon.ico is in the
 // root directory.
 var url = collector.addHttpResource("../content-tabs/html", "");
 var whatsUrl = url + "whatsnew.html";
 
-function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-}
-
 function test_content_tab_open() {
   let tab = open_content_tab_with_url(whatsUrl);
 
   assert_tab_has_title(tab, "What's New Content Test");
   // Check the location of the what's new image, this is via the link element
   // and therefore should be set and not favicon.png.
   assert_content_tab_has_favicon(tab, url + "whatsnew.png");
 
@@ -205,8 +211,14 @@ function test_content_tab_onbeforeunload
 
   Services.prefs.clearUserPref(interactionPref);
 }
 
 // XXX todo
 // - test find bar
 // - window.close within tab
 // - zoom?
+
+function teardownModule() {
+  while (mc.tabmail.tabInfo.length > 1) {
+    mc.tabmail.closeTab(1);
+  }
+}
--- a/mail/test/mozmill/content-tabs/test-install-xpi.js
+++ b/mail/test/mozmill/content-tabs/test-install-xpi.js
@@ -1,45 +1,41 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-install-xpi";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers"];
-
 var controller = ChromeUtils.import(
   "chrome://mozmill/content/modules/controller.jsm"
 );
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 var mozmill = ChromeUtils.import(
   "chrome://mozmill/content/modules/mozmill.jsm"
 );
+
+var { content_tab_eid, open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../content-tabs/html", "content-tabs");
 
 var gDocument;
 var gNewTab;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-
   gDocument = mc.window.document;
   gNewTab = open_content_tab_with_url(
     url + "installxpi.html",
     "specialTabs.siteClickHandler(event, new RegExp('^" + url + "'));"
   );
 }
 
 var teardownModule = function(module) {
--- a/mail/test/mozmill/cookies/test-cookies.js
+++ b/mail/test/mozmill/cookies/test-cookies.js
@@ -5,34 +5,27 @@
 /**
  * Test file to check that cookies are correctly enabled in Thunderbird.
  *
  * XXX: Still need to check remote content in messages.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-cookies";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["content-tab-helpers", "folder-display-helpers"];
+var { open_content_tab_with_url } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var { mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 var url = collector.addHttpResource("../cookies/html", "cookies");
 
-function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-}
-
 /**
  * Test deleting junk messages with no messages marked as junk.
  */
 function test_load_cookie_page() {
   open_content_tab_with_url(url + "cookietest1.html");
 }
 
 function test_load_cookie_result_page() {
--- a/mail/test/mozmill/downloads/test-about-downloads.js
+++ b/mail/test/mozmill/downloads/test-about-downloads.js
@@ -3,41 +3,47 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Test about:downloads.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-dom-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-about-downloads";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "content-tab-helpers",
-  "dom-helpers",
-  "folder-display-helpers",
-];
-
 var elementslib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
-var { wait_for_browser_load } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
 var { gMockFilePicker, gMockFilePickReg } = ChromeUtils.import(
   "resource://testing-common/mozmill/AttachmentHelpers.jsm"
 );
+var { content_tab_e, content_tab_eid } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  select_click_row,
+  switch_tab,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var { wait_for_browser_load } = ChromeUtils.import(
+  "resource://testing-common/mozmill/WindowHelpers.jsm"
+);
 
 var downloads = ChromeUtils.import("resource://gre/modules/Downloads.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var downloadsTab;
 
 var attachmentFileNames = [
   "Attachment#1.txt",
   "Attachment#2.txt",
   "Attachment#3.txt",
 ];
@@ -116,19 +122,16 @@ function prepare_downloads_view() {
   let success = false;
   downloads.Downloads.getList(downloads.Downloads.ALL)
     .then(list => list.addView(downloadsView))
     .then(() => (success = true), Cu.reportError);
   mc.waitFor(() => success, "Timeout waiting for attaching our download view.");
 }
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
   gMockFilePickReg.register();
 
   prepare_messages();
   prepare_downloads_view();
 
   downloadsTab = open_about_downloads();
 }
 
--- a/mail/test/mozmill/folder-display/test-archive-messages.js
+++ b/mail/test/mozmill/folder-display/test-archive-messages.js
@@ -1,31 +1,42 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-archive-messages";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  add_sets_to_folders,
+  archive_messages,
+  assert_message_not_in_view,
+  assert_nothing_selected,
+  assert_selected,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  create_thread,
+  make_display_threaded,
+  mc,
+  select_click_row,
+  select_none,
+  select_shift_click_row,
+  toggle_thread_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 /**
  * The number of messages in the thread we use to test.
  */
 var NUM_MESSAGES_IN_THREAD = 6;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("ThreadedMessages");
   let thread = create_thread(NUM_MESSAGES_IN_THREAD);
   add_sets_to_folders([folder], [thread]);
   thread = create_thread(NUM_MESSAGES_IN_THREAD);
   add_sets_to_folders([folder], [thread]);
 }
 
 /**
--- a/mail/test/mozmill/folder-display/test-close-window-on-delete.js
+++ b/mail/test/mozmill/folder-display/test-close-window-on-delete.js
@@ -3,34 +3,42 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that the close message window on delete option works.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-close-window-on-delete";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  assert_number_of_tabs_open,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_selected_message_in_new_tab,
+  open_selected_message_in_new_window,
+  press_delete,
+  reset_close_message_on_delete,
+  select_click_row,
+  set_close_message_on_delete,
+  switch_tab,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   close_window,
   plan_for_window_close,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("CloseWindowOnDeleteA");
 
   make_new_sets_in_folder(folder, [{ count: 10 }]);
 }
 
 /**
  * Delete a message and check that the message window is closed
  * where appropriate.
--- a/mail/test/mozmill/folder-display/test-columns.js
+++ b/mail/test/mozmill/folder-display/test-columns.js
@@ -5,33 +5,42 @@
 /*
  * Test column default logic and persistence logic.  Persistence comes in both
  *  tab-switching (because of the multiplexed implementation) and
  *  folder-switching forms.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-columns";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
 var {
+  be_in_folder,
+  close_tab,
+  create_folder,
+  create_virtual_folder,
+  enter_folder,
+  inboxFolder,
+  mc,
+  open_folder_in_new_tab,
+  switch_tab,
+  wait_for_all_messages_to_load,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
   plan_for_modal_dialog,
   plan_for_observable_event,
   wait_for_modal_dialog,
   wait_for_observable_event,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 // needed to zero inter-folder processing delay
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 var folderInbox, folderSent, folderVirtual, folderA, folderB;
 // INBOX_DEFAULTS sans 'dateCol' but gains 'tagsCol'
 var columnsB;
 // GLODA_DEFAULTS sans 'locationCol' but gains 'accountCol'
 var glodaColumns;
@@ -43,19 +52,16 @@ var gColumnStateUpdated = false;
 
 var useCorrespondent;
 var INBOX_DEFAULTS;
 var SENT_DEFAULTS;
 var VIRTUAL_DEFAULTS;
 var GLODA_DEFAULTS;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   useCorrespondent = Services.prefs.getBoolPref(
     "mail.threadpane.use_correspondents"
   );
   INBOX_DEFAULTS = [
     "threadCol",
     "flaggedCol",
     "attachmentCol",
     "subjectCol",
@@ -655,8 +661,14 @@ function test_reset_columns_gloda_collec
 
   invoke_column_picker_option([{ anonid: "menuitem" }]); // reset!
   assert_visible_columns(glodaColumns); // same, only order (would be) reset
 
   mc.tabmail.openTab("glodaList", { collection: fakeCollection });
   wait_for_all_messages_to_load();
   assert_visible_columns(glodaColumns);
 }
+
+function teardownModule() {
+  while (mc.tabmail.tabInfo.length > 1) {
+    mc.tabmail.closeTab(1);
+  }
+}
--- a/mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
+++ b/mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
@@ -3,44 +3,58 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that deleting messages works from a virtual folder.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-deletion-from-virtual-folders";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  assert_messages_in_view,
+  assert_selected_and_displayed,
+  assert_tab_titled_from,
+  be_in_folder,
+  create_folder,
+  get_smart_folder_named,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+  open_selected_message_in_new_tab,
+  open_selected_message_in_new_window,
+  press_delete,
+  select_click_row,
+  switch_tab,
+  wait_for_all_messages_to_load,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   plan_for_modal_dialog,
   plan_for_window_close,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
+var { MailViewConstants } = ChromeUtils.import(
+  "resource:///modules/MailViewManager.jsm"
+);
+
 var baseFolder, folder, lastMessageFolder;
 
 var tabFolder, tabMessage, tabMessageBackground, curMessage, nextMessage;
 
 var setNormal;
 
 /**
  * The message window controller.
  */
 var msgc;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   baseFolder = create_folder("DeletionFromVirtualFoldersA");
   // For setTagged, we want exactly as many messages as we plan to delete, so
   // that we can test that the message window and tabs close when they run out
   // of things to display.
   let [, setTagged] = make_new_sets_in_folder(baseFolder, [
     { count: 4 },
     { count: 4 },
   ]);
--- a/mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
+++ b/mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
@@ -7,39 +7,49 @@
  *  that tab/window as well as all other tabs/windows.  We also test that the
  *  message tab title updates appropriately through all of this. We do all of
  *  this both for tabs that have ever been opened in the foreground, and tabs
  *  that haven't (and thus might have fake selections).
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-deletion-with-multiple-displays";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  assert_selected_and_displayed,
+  assert_tab_titled_from,
+  be_in_folder,
+  close_message_window,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_selected_message_in_new_tab,
+  open_selected_message_in_new_window,
+  press_delete,
+  select_click_row,
+  select_control_click_row,
+  select_shift_click_row,
+  switch_tab,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var folder,
   lastMessageFolder,
   oneBeforeFolder,
   oneAfterFolder,
   multipleDeletionFolder1,
   multipleDeletionFolder2,
   multipleDeletionFolder3,
   multipleDeletionFolder4;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("DeletionA");
   lastMessageFolder = create_folder("DeletionB");
   oneBeforeFolder = create_folder("DeletionC");
   oneAfterFolder = create_folder("DeletionD");
   multipleDeletionFolder1 = create_folder("DeletionE");
   multipleDeletionFolder2 = create_folder("DeletionF");
   multipleDeletionFolder3 = create_folder("DeletionG");
   multipleDeletionFolder4 = create_folder("DeletionH");
--- a/mail/test/mozmill/folder-display/test-display-name.js
+++ b/mail/test/mozmill/folder-display/test-display-name.js
@@ -4,22 +4,30 @@
 
 /*
  * Test that the display names in email addresses are correctly shown in the
  * thread pane.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-display-name";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
+var { ensure_card_exists } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var {
+  add_message_to_folder,
+  assert_equals,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 var messages = [
   // Basic From header tests
   {
     name: "from_display_name_unquoted",
     headers: { From: "Carter Burke <cburke@wyutani.invalid>" },
@@ -183,20 +191,16 @@ var messages = [
 ];
 
 var contacts = [
   { email: "aapone@uscmc.invalid", name: "Sarge", pdn: true },
   { email: "rjorden@hadleys-hope.invalid", name: "Newt", pdn: false },
 ];
 
 function setupModule(module) {
-  for (let req of MODULE_REQUIRES) {
-    collector.getModule(req).installInto(module);
-  }
-
   folder = create_folder("DisplayNameA");
 
   for (let message of messages) {
     add_message_to_folder(
       folder,
       create_message({
         clobberHeaders: message.headers,
       })
deleted file mode 100644
--- a/mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
+++ /dev/null
@@ -1,400 +0,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/. */
-
-/*
- * Test displaying messages in folder tabs. This is supposed to test a variety
- * of situations, including:
- * - dropping view filters to select the message
- * - displaying the message in an existing folder tab
- */
-
-"use strict";
-
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-search-window-helpers.js */
-
-var MODULE_NAME = "test-displaying-messages-in-folder-tabs";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "search-window-helpers"];
-
-var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-var folderA;
-var folderB;
-var folderC;
-
-var folderTab;
-
-var msgHdrsInFolderA = [],
-  msgHdrsInFolderB = [];
-
-// The number of messages in folderA/folderB.
-var NUM_MESSAGES_IN_FOLDER = 10;
-
-// A generator for indexes to load test.
-function* _generateIndexes() {
-  let index = 0;
-  while (true) {
-    yield index;
-    index = (index + 1) % NUM_MESSAGES_IN_FOLDER;
-  }
-}
-var indexes = _generateIndexes();
-
-function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let sh = collector.getModule("search-window-helpers");
-  sh.installInto(module);
-
-  folderA = create_folder("DisplayMessageFolderTabA");
-  folderB = create_folder("DisplayMessageFolderTabB");
-  folderC = create_folder("DisplayMessageFolderTabC");
-  make_new_sets_in_folder(folderA, [{ count: NUM_MESSAGES_IN_FOLDER }]);
-  let [, taggedMsg] = make_new_sets_in_folder(folderB, [
-    { count: NUM_MESSAGES_IN_FOLDER - 1 },
-    { count: 1 },
-  ]);
-  taggedMsg.addTag("$label3");
-  make_new_sets_in_folder(folderC, [{ count: 50 }]);
-}
-
-/**
- * Helper to test that a new 3-pane window is opened, a message is displayed,
- * and that the message is visible in the thread pane, even if there are no
- * 3-pane windows open.
- *
- * This test is done right at the beginning so that the globals set up right
- * after that are valid for all the other tests.
- */
-function test_display_message_with_no_3pane_windows_open() {
-  be_in_folder(folderC);
-  // Scroll to the top
-  mc.folderDisplay.ensureRowIsVisible(0);
-  let msgHdr = mc.dbView.getMsgHdrAt(45);
-
-  // Switch to a different folder, just to exercise that code
-  be_in_folder(folderB);
-
-  // Make sure we have a different window open, so that we don't start shutting
-  // down just because the last window was closed.
-  let swc = open_search_window();
-
-  plan_for_window_close(mc);
-  mc.window.close();
-  wait_for_window_close();
-
-  display_message_in_folder_tab(msgHdr, true);
-
-  // We don't need the search window any more
-  plan_for_window_close(swc);
-  swc.window.close();
-  wait_for_window_close();
-
-  // Check that the right message is displayed
-  assert_number_of_tabs_open(1);
-  assert_folder_selected_and_displayed(folderC);
-  assert_selected_and_displayed(msgHdr);
-  // Check that row 45 is visible
-  assert_row_visible(45);
-}
-
-/**
- * Initialize the globals we'll need for all our tests.
- */
-function test_setup_displaying_messages_in_folder_tabs_globals() {
-  // We don't obey mail view persistence unless the view picker is there.
-  // XXX We used to do this in setupModule, but window.close() seems to cause
-  // bad problems with the toolbar item's persistence. (This seems to be an
-  // issue only in tests.)
-  add_to_toolbar(mc.e("mail-bar3"), "mailviews-container");
-
-  folderTab = mc.tabmail.currentTabInfo;
-
-  // Stash messages into arrays for convenience. We do it this way so that the
-  // order of messages in the arrays is the same as in the views.
-  be_in_folder(folderA);
-  for (let i = 0; i < NUM_MESSAGES_IN_FOLDER; i++) {
-    msgHdrsInFolderA.push(mc.dbView.getMsgHdrAt(i));
-  }
-  be_in_folder(folderB);
-  for (let i = 0; i < NUM_MESSAGES_IN_FOLDER; i++) {
-    msgHdrsInFolderB.push(mc.dbView.getMsgHdrAt(i));
-  }
-
-  // Mark all messages read -- we need this for some tests
-  folderA.markAllMessagesRead(null);
-  folderB.markAllMessagesRead(null);
-}
-
-/**
- * Verifies that no new tab was opened, and that the right folder and message
- * were selected in the same tab.
- */
-function _verify_display_in_existing_tab(aPreCount, aFolder, aMsgHdr) {
-  // Verify that a new tab has not been opened
-  assert_number_of_tabs_open(aPreCount);
-  // Verify that the current tab is the folder tab
-  assert_selected_tab(folderTab);
-  // Verify that the correct folder is selected
-  assert_folder_selected_and_displayed(aFolder);
-  // Verify that the correct message is displayed
-  assert_selected_and_displayed(aMsgHdr);
-}
-
-/**
- * Test displaying a message with the same folder already open.
- */
-function test_display_message_in_same_folder() {
-  be_in_folder(folderA);
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-}
-
-/**
- * Test displaying a message with a different folder open.
- */
-function test_display_message_in_different_folder() {
-  be_in_folder(folderB);
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-}
-
-/**
- * Test displaying a message with a message tab active.
- */
-function test_display_message_in_same_folder_with_message_tab_active() {
-  be_in_folder(folderA);
-
-  let indexToOpen = indexes.next().value;
-  select_click_row(indexToOpen);
-  let messageTab = open_selected_message_in_new_tab(false);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-
-  // Clean up, close the message tab
-  close_tab(messageTab);
-}
-
-/**
- * Test displaying a message with a different folder open and a message tab
- * active.
- */
-function test_display_message_in_different_folder_with_message_tab_active() {
-  be_in_folder(folderA);
-
-  let indexToOpen = indexes.next().value;
-  select_click_row(indexToOpen);
-  let messageTab = open_selected_message_in_new_tab(false);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderB[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderB, msgHdr);
-
-  // Clean up, close the message tab
-  close_tab(messageTab);
-}
-
-/**
- * Test displaying a message with the same folder open but filtered.
- */
-function test_display_message_in_same_folder_filtered() {
-  be_in_folder(folderA);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label1");
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderA);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-
-  // Reset the mail view
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-}
-
-/**
- * Test displaying a message with the folder filtered, and another folder open.
- */
-function test_display_message_in_different_folder_filtered() {
-  be_in_folder(folderB);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label1");
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderB);
-
-  // Do the same for folder A
-  be_in_folder(folderA);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label2");
-  assert_messages_not_in_view(msgHdrsInFolderA);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderB[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderB, msgHdr);
-  // Reset folder B's state
-  be_in_folder(folderB);
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-
-  // Now get back to folder A, and check that its state hasn't changed
-  be_in_folder(folderA);
-  assert_mail_view(MailViewConstants.kViewItemTags, "$label2");
-  // Reset folder A's state
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-}
-
-/**
- * Test displaying a message with the folder filtered and a message tab active.
- */
-function test_display_message_in_same_folder_filtered_with_message_tab_active() {
-  be_in_folder(folderB);
-
-  let indexToOpen = indexes.next().value;
-  select_click_row(indexToOpen);
-  let messageTab = open_selected_message_in_new_tab(false);
-
-  switch_tab(folderTab);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label1");
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderB);
-  switch_tab(messageTab);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderB[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderB, msgHdr);
-
-  // Clean up, close the message tab and reset the mail view
-  close_tab(messageTab);
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-}
-
-/**
- * Test displaying a message with the folder filtered, a different folder open,
- * and a message tab active.
- */
-function test_display_message_in_different_folder_filtered_with_message_tab_active() {
-  be_in_folder(folderA);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label1");
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderA);
-
-  be_in_folder(folderB);
-  set_mail_view(MailViewConstants.kViewItemTags, "$label3");
-  // There should be one message in here
-  select_click_row(0);
-  let messageTab = open_selected_message_in_new_tab(false);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-  // Close the message tab
-  close_tab(messageTab);
-  // Reset folder A's state
-  be_in_folder(folderA);
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-
-  // Now get back to folder B, and check that its state hasn't changed
-  be_in_folder(folderB);
-  assert_mail_view(MailViewConstants.kViewItemTags, "$label3");
-  // Reset folder B's state
-  set_mail_view(MailViewConstants.kViewItemAll, null);
-}
-
-/**
- * Test displaying a message with the folder set to show unread messages only.
- */
-function test_display_message_in_same_folder_unread() {
-  be_in_folder(folderB);
-  set_show_unread_only(true);
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderB);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderB[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderB, msgHdr);
-  // Reset the state
-  be_in_folder(folderB);
-  set_show_unread_only(false);
-}
-
-/**
- * Test displaying a message with the folder set to show unread messages only,
- * and a different folder open.
- */
-function test_display_message_in_different_folder_unread() {
-  be_in_folder(folderA);
-  set_show_unread_only(true);
-  // Make sure all the messages have actually disappeared
-  assert_messages_not_in_view(msgHdrsInFolderA);
-
-  // Do the same for folder B
-  be_in_folder(folderB);
-  set_show_unread_only(true);
-  assert_messages_not_in_view(msgHdrsInFolderB);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = msgHdrsInFolderA[indexes.next().value];
-  display_message_in_folder_tab(msgHdr);
-  // Verify
-  _verify_display_in_existing_tab(preCount, folderA, msgHdr);
-  // Reset folder A's state
-  be_in_folder(folderA);
-  set_show_unread_only(false);
-
-  // Now get back to folder B, and check that its state hasn't changed
-  be_in_folder(folderB);
-  assert_showing_unread_only();
-  // Reset folder B's state
-  set_show_unread_only(false);
-}
-
-/**
- * Test that we correctly scroll to the index of the message in a folder.
- */
-function test_display_message_scrolls_to_message() {
-  be_in_folder(folderC);
-  // Scroll to the top
-  mc.folderDisplay.ensureRowIsVisible(0);
-
-  let preCount = mc.tabmail.tabContainer.allTabs.length;
-  let msgHdr = mc.dbView.getMsgHdrAt(45);
-  display_message_in_folder_tab(msgHdr);
-
-  // Check that row 45 is visible
-  assert_row_visible(45);
-  // Verify the rest
-  _verify_display_in_existing_tab(preCount, folderC, msgHdr);
-}
-
-/**
- * Clean up and remove the view picker.
- */
-function test_cleanup() {
-  remove_from_toolbar(mc.e("mail-bar3"), "mailviews-container");
-}
--- a/mail/test/mozmill/folder-display/test-folder-pane-visibility.js
+++ b/mail/test/mozmill/folder-display/test-folder-pane-visibility.js
@@ -4,28 +4,33 @@
 
 /*
  * Test that the folder pane collapses properly, stays collapsed amongst tab
  * changes, and that persistence works (to a first approximation).
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-folder-pane-visibility";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_folder_in_new_tab,
+  open_selected_message_in_new_tab,
+  select_click_row,
+  switch_tab,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("FolderPaneVisibility");
   make_new_sets_in_folder(folder, [{ count: 3 }]);
 }
 
 /**
  * When displaying a folder, assert that the folder pane is visible and all the
  * menus, splitters, etc. are set up right.
  */
--- a/mail/test/mozmill/folder-display/test-folder-toolbar.js
+++ b/mail/test/mozmill/folder-display/test-folder-toolbar.js
@@ -4,28 +4,39 @@
 
 /*
  * Test that opening new folder and message tabs has the expected result and
  *  that closing them doesn't break anything.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-folder-toolbar";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  add_to_toolbar,
+  assert_equals,
+  assert_folder_selected_and_displayed,
+  assert_nothing_selected,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_folder_in_new_tab,
+  open_selected_message_in_new_tab,
+  remove_from_toolbar,
+  select_click_row,
+  switch_tab,
+  wait_for_blank_content_pane,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folderA, folderB;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folderA = create_folder("FolderToolbarA");
   // we need one message to select and open
   folderB = create_folder("FolderToolbarB");
   make_new_sets_in_folder(folderB, [{ count: 1 }]);
 }
 
 function test_add_folder_toolbar() {
   // It should not be present by default
--- a/mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
+++ b/mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
@@ -5,29 +5,32 @@
 /*
  * Test that clicking on a folder with an invalid or missing .msf file
  * regenerates the.msf file and loads the view.
  * Also, check that rebuilding the index on a loaded folder reloads the folder.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-invalid-db-folder-load";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_messages_in_view,
+  assert_selected_and_displayed,
+  be_in_folder,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 var setA;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("InvalidMSF");
   [setA] = make_new_sets_in_folder(folder, [{ count: 3 }]);
 }
 
 /**
  * Check if the db of a folder assumed to be invalid can be restored.
  */
 function test_load_folder_with_invalidDB() {
--- a/mail/test/mozmill/folder-display/test-mail-views.js
+++ b/mail/test/mozmill/folder-display/test-mail-views.js
@@ -1,39 +1,40 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-mail-views";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  assert_messages_in_view,
+  be_in_folder,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  wait_for_all_messages_to_load,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { MailViewConstants } = ChromeUtils.import(
   "resource:///modules/MailViewManager.jsm"
 );
 
 var baseFolder, savedFolder;
 var setUntagged, setTagged;
 
 var setupModule = function(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   // Create a folder with some messages that have no tags and some that are
   //  tagged Important ($label1).
   baseFolder = create_folder("MailViewA");
   [setUntagged, setTagged] = make_new_sets_in_folder(baseFolder, [{}, {}]);
   setTagged.addTag("$label1"); // Important, by default
 };
 
 function test_put_view_picker_on_toolbar() {
--- a/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
+++ b/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
@@ -6,23 +6,36 @@
  * This tests some commands on messages via the UI. But we specifically check,
  * whether the commands have an effect in the message store on disk, i.e. the
  * markings on the messages are stored in the msgStore, not only in the database.
  * For now, it checks for bug 840418.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-compose-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-commands-on-msgstore";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers"];
-
+var { open_compose_with_forward, open_compose_with_reply } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ComposeHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  empty_folder,
+  get_special_folder,
+  make_new_sets_in_folder,
+  mc,
+  press_delete,
+  right_click_on_row,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
@@ -30,20 +43,16 @@ var { IOUtils } = ChromeUtils.import("re
 
 var statusHeader = "X-Mozilla-Status: ";
 
 var gInbox;
 var gOutbox;
 var gAutoRead;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   gAutoRead = Services.prefs.getBoolPref("mailnews.mark_message_read.auto");
   Services.prefs.setBoolPref("mailnews.mark_message_read.auto", false);
 
   gOutbox = get_special_folder(Ci.nsMsgFolderFlags.Queue);
   gInbox = create_folder("MsgStoreChecks");
   make_new_sets_in_folder(gInbox, [{ count: 6 }]);
 
   // We delete the first message so that we have to compact anything.
--- a/mail/test/mozmill/folder-display/test-message-commands.js
+++ b/mail/test/mozmill/folder-display/test-message-commands.js
@@ -5,43 +5,63 @@
 /**
  * This tests various commands on messages. This is primarily for commands
  * that can't be tested with xpcshell tests because they're handling in the
  * front end - which is why Archive is the only command currently tested.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-commands";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers"];
-
+var { wait_for_content_tab_load } = ChromeUtils.import(
+  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
+);
+var {
+  add_sets_to_folders,
+  archive_selected_messages,
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  close_popup,
+  collapse_all_threads,
+  create_folder,
+  create_thread,
+  make_display_threaded,
+  make_display_unthreaded,
+  make_new_sets_in_folder,
+  mc,
+  press_delete,
+  right_click_on_row,
+  select_click_row,
+  select_control_click_row,
+  select_shift_click_row,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 var unreadFolder, shiftDeleteFolder, threadDeleteFolder;
 var archiveSrcFolder = null;
 var archiveURI;
 
 var acctMgr;
 var tagArray;
 
 var setupModule = function(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let cth = collector.getModule("content-tab-helpers");
-  cth.installInto(module);
-
   unreadFolder = create_folder("UnreadFolder");
   shiftDeleteFolder = create_folder("ShiftDeleteFolder");
   threadDeleteFolder = create_folder("ThreadDeleteFolder");
   archiveSrcFolder = create_folder("ArchiveSrc");
 
   make_new_sets_in_folder(unreadFolder, [{ count: 2 }]);
   make_new_sets_in_folder(shiftDeleteFolder, [{ count: 3 }]);
   add_sets_to_folders(
@@ -597,14 +617,16 @@ function test_tag_keys_disabled_in_conte
 
   let tab = mc.tabmail.currentTabInfo;
   wait_for_content_tab_load(tab, "about:addons", 15000);
 
   // Make sure pressing the "1" key in a content tab doesn't tag a message
   check_tag_in_message(curMessage, tagArray[0], false);
   mc.keypress(null, "1", {});
   check_tag_in_message(curMessage, tagArray[0], false);
+
+  mc.tabmail.closeTab(tab);
 }
 
 function teardownModule() {
   // Make sure archiving is enabled at the end
   enable_archiving(true);
 }
--- a/mail/test/mozmill/folder-display/test-message-pane-visibility.js
+++ b/mail/test/mozmill/folder-display/test-message-pane-visibility.js
@@ -4,28 +4,36 @@
 
 /*
  * Test that the message pane collapses properly, stays collapsed amongst tab
  *  changes, and that persistence works (to a first approximation).
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-pane-visibility";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_message_pane_hidden,
+  assert_message_pane_visible,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_folder_in_new_tab,
+  open_selected_message_in_new_tab,
+  select_click_row,
+  switch_tab,
+  toggle_message_pane,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("MessagePaneVisibility");
   make_new_sets_in_folder(folder, [{ count: 3 }]);
 }
 
 /**
  * By default, the message pane should be visible.  Make sure that this state of
  *  affairs is correct in terms of menu options, splitters, etc.
  */
--- a/mail/test/mozmill/folder-display/test-message-reloads.js
+++ b/mail/test/mozmill/folder-display/test-message-reloads.js
@@ -4,45 +4,54 @@
 
 /*
  * Test that message reloads happen properly when the message pane is hidden,
  * and then made visible again.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-reloads";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_message_pane_hidden,
+  assert_message_pane_visible,
+  assert_selected_and_displayed,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  open_folder_in_new_tab,
+  select_click_row,
+  switch_tab,
+  toggle_message_pane,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("MessageReloads");
   make_new_sets_in_folder(folder, [{ count: 1 }]);
 }
 
 function test_message_reloads_work_with_message_pane_toggles() {
   be_in_folder(folder);
 
   assert_message_pane_visible();
   select_click_row(0);
   // Toggle the message pane off, then on
   toggle_message_pane();
   assert_message_pane_hidden();
   toggle_message_pane();
   assert_message_pane_visible();
   // Open a new tab with the same message
-  open_folder_in_new_tab(folder);
+  let tab = open_folder_in_new_tab(folder);
   // Toggle the message pane off
   assert_message_pane_visible();
   toggle_message_pane();
   assert_message_pane_hidden();
   // Go back to the first tab, and make sure the message is actually displayed
   switch_tab(0);
   assert_message_pane_visible();
   assert_selected_and_displayed(0);
+
+  close_tab(tab);
 }
--- a/mail/test/mozmill/folder-display/test-message-size.js
+++ b/mail/test/mozmill/folder-display/test-message-size.js
@@ -5,28 +5,30 @@
 
 /*
  * Test that the size column of in the message list is formatted properly (e.g.
    0.1 KB, 1.2 KB, 12.3 KB, 123 KB, and likewise for MB and GB).
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-size";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  add_message_to_folder,
+  be_in_folder,
+  create_folder,
+  create_message,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("MessageSizeA");
 
   // Create messages with sizes in the byte, KB, and MB ranges.
   let bytemsg = create_message({ body: { body: " " } });
 
   let kbstring = "x ".repeat(1024 / 2);
   let kbmsg = create_message({ body: { body: kbstring } });
 
--- a/mail/test/mozmill/folder-display/test-message-window.js
+++ b/mail/test/mozmill/folder-display/test-message-window.js
@@ -4,36 +4,42 @@
 
 /*
  * Test that we can open and close a standalone message display window from the
  *  folder pane.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-window";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  add_sets_to_folders,
+  assert_selected_and_displayed,
+  assert_true,
+  be_in_folder,
+  create_folder,
+  create_thread,
+  open_selected_message_in_new_window,
+  plan_for_message_display,
+  press_delete,
+  select_click_row,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   plan_for_modal_dialog,
   plan_for_window_close,
   wait_for_modal_dialog,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var folderA, folderB;
 var curMessage;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folderA = create_folder("MessageWindowA");
   folderB = create_folder("MessageWindowB");
   // create three messages in the folder to display
   let msg1 = create_thread(1);
   let msg2 = create_thread(1);
   let thread1 = create_thread(2);
   let thread2 = create_thread(2);
   add_sets_to_folders([folderA], [msg1, msg2, thread1, thread2]);
--- a/mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
+++ b/mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
@@ -5,41 +5,59 @@
 /*
  * Test that messages without a backing view are opened correctly. Examples of
  * messages without a backing view are those opened from the command line or
  * desktop search integration results.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-opening-messages-without-a-backing-view";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  add_to_toolbar,
+  assert_message_pane_focused,
+  assert_messages_not_in_view,
+  assert_number_of_tabs_open,
+  assert_selected_and_displayed,
+  assert_tab_mode_name,
+  assert_tab_titled_from,
+  be_in_folder,
+  close_message_window,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  plan_for_message_display,
+  remove_from_toolbar,
+  reset_open_message_behavior,
+  set_mail_view,
+  set_open_message_behavior,
+  switch_tab,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_new_window, wait_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
+var { MailViewConstants } = ChromeUtils.import(
+  "resource:///modules/MailViewManager.jsm"
+);
 
 // One folder's enough
 var folder = null;
 
 // A list of the message headers in this folder
 var msgHdrsInFolder = null;
 
 // Number of messages to open for multi-message tests
 var NUM_MESSAGES_TO_OPEN = 5;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("OpeningMessagesNoBackingViewA");
   make_new_sets_in_folder(folder, [{ count: 10 }]);
   // We don't obey mail view persistence unless the view picker is there
   add_to_toolbar(mc.e("mail-bar3"), "mailviews-container");
 }
 
 /**
  * Test opening a single message without a backing view in a new tab.
--- a/mail/test/mozmill/folder-display/test-opening-messages.js
+++ b/mail/test/mozmill/folder-display/test-opening-messages.js
@@ -13,36 +13,52 @@
  *   amount of additional work and are hard to test. We're also assuming here
  *   that multiple messages opened in windows are just the same function called
  *   repeatedly.)
  * - reusing an existing window to show another message
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-opening-messages";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  assert_equals,
+  assert_message_pane_focused,
+  assert_number_of_tabs_open,
+  assert_selected_and_displayed,
+  assert_tab_mode_name,
+  assert_tab_titled_from,
+  be_in_folder,
+  close_message_window,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  open_selected_message,
+  open_selected_messages,
+  plan_for_message_display,
+  reset_open_message_behavior,
+  select_click_row,
+  select_shift_click_row,
+  set_open_message_behavior,
+  switch_tab,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { plan_for_new_window, wait_for_new_window } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 // One folder's enough
 var folder = null;
 
 // Number of messages to open for multi-message tests
 var NUM_MESSAGES_TO_OPEN = 5;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("OpeningMessagesA");
   make_new_sets_in_folder(folder, [{ count: 10 }]);
 }
 
 /**
  * Test opening a single message in a new tab.
  */
 function test_open_single_message_in_tab() {
--- a/mail/test/mozmill/folder-display/test-pane-focus.js
+++ b/mail/test/mozmill/folder-display/test-pane-focus.js
@@ -3,28 +3,40 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that cycling through the focus of the 3pane's panes works correctly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  add_sets_to_folders,
+  assert_equals,
+  be_in_folder,
+  close_tab,
+  collapse_all_threads,
+  create_folder,
+  create_thread,
+  make_display_threaded,
+  mc,
+  open_selected_message_in_new_tab,
+  press_delete,
+  select_click_row,
+  select_none,
+  switch_tab,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-pane-focus";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("PaneFocus");
   let msg1 = create_thread(1);
   let thread = create_thread(3);
   let msg2 = create_thread(1);
   add_sets_to_folders([folder], [msg1, thread, msg2]);
 
   be_in_folder(folder);
   make_display_threaded();
--- a/mail/test/mozmill/folder-display/test-recent-menu.js
+++ b/mail/test/mozmill/folder-display/test-recent-menu.js
@@ -5,38 +5,43 @@
 /**
  * This tests the move/copy to recent folder menus to make sure
  * that they get updated when messages are moved to folders, and
  * don't get updated when we archive.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-recent-menu";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  archive_selected_messages,
+  assert_equals,
+  be_in_folder,
+  create_folder,
+  get_special_folder,
+  make_new_sets_in_folder,
+  mc,
+  press_delete,
+  right_click_on_row,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 var { fixIterator } = ChromeUtils.import(
   "resource:///modules/iteratorUtils.jsm"
 );
 
 var folder1, folder2;
 var gInitRecentMenuCount;
 
 var setupModule = function(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   // Ensure that there are no updated folders to ensure the recent folder
   // is empty.
   let allFolders = MailServices.accounts.allFolders;
   for (let folder of fixIterator(allFolders, Ci.nsIMsgFolder)) {
     folder.setStringProperty("MRMTime", "0");
   }
 
   // Try to make these folders first in alphabetic order
--- a/mail/test/mozmill/folder-display/test-right-click-middle-click-folders.js
+++ b/mail/test/mozmill/folder-display/test-right-click-middle-click-folders.js
@@ -4,28 +4,44 @@
 
 /*
  * Test the many horrors involving right-clicks, middle clicks, and
  * selections... on folders!
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-right-click-middle-click-folders";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_folder_displayed,
+  assert_folder_selected,
+  assert_folder_selected_and_displayed,
+  assert_folders_selected_and_displayed,
+  assert_no_folders_selected,
+  assert_selected_tab,
+  be_in_folder,
+  close_popup,
+  close_tab,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  middle_click_on_folder,
+  reset_context_menu_background_tabs,
+  right_click_on_folder,
+  select_click_folder,
+  select_no_folders,
+  select_shift_click_folder,
+  set_context_menu_background_tabs,
+  switch_tab,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folderA, folderB, folderC;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folderA = create_folder("RightClickMiddleClickFoldersA");
   folderB = create_folder("RightClickMiddleClickFoldersB");
   folderC = create_folder("RightClickMiddleClickFoldersC");
 
   // We aren't really interested in the messages the folders contain, but just
   // for appearance's sake, add a message to each folder
 
   make_new_sets_in_folder(folderA, [{ count: 1 }]);
--- a/mail/test/mozmill/folder-display/test-right-click-middle-click-messages.js
+++ b/mail/test/mozmill/folder-display/test-right-click-middle-click-messages.js
@@ -3,37 +3,65 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test the many horrors involving right-clicks, middle clicks, and selections.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-right-click-middle-click-messages";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  add_sets_to_folders,
+  assert_displayed,
+  assert_message_not_in_view,
+  assert_message_pane_focused,
+  assert_messages_not_in_view,
+  assert_nothing_selected,
+  assert_selected,
+  assert_selected_and_displayed,
+  assert_selected_tab,
+  assert_thread_tree_focused,
+  be_in_folder,
+  close_popup,
+  close_tab,
+  collapse_all_threads,
+  create_folder,
+  create_thread,
+  delete_via_popup,
+  expand_all_threads,
+  focus_thread_tree,
+  make_display_threaded,
+  make_new_sets_in_folder,
+  mc,
+  middle_click_on_row,
+  reset_context_menu_background_tabs,
+  right_click_on_row,
+  select_click_row,
+  select_none,
+  select_shift_click_row,
+  set_context_menu_background_tabs,
+  switch_tab,
+  wait_for_message_display_completion,
+  wait_for_popup_to_open,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+
 var folder, threadedFolder;
 
 /**
  * The number of messages in the thread we use to test.
  */
 var NUM_MESSAGES_IN_THREAD = 6;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("RightClickMiddleClickA");
   threadedFolder = create_folder("RightClickMiddleClickB");
   // we want exactly as many messages as we plan to delete, so that we can test
   //  that the message window and tabs close when they run out of things to
   //  to display.
   make_new_sets_in_folder(folder, [{ count: 20 }]);
   // Create a few messages and one thread (the order is important here, as it
   // determines where the thread is placed. We want it placed right at the
--- a/mail/test/mozmill/folder-display/test-savedsearch-reload-after-compact.js
+++ b/mail/test/mozmill/folder-display/test-savedsearch-reload-after-compact.js
@@ -4,26 +4,28 @@
 
 /**
  * Test reload of saved searches over local folders after compaction
  * of local folders.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-savedsearch-reload-after-compact";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
-function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-}
+var {
+  be_in_folder,
+  create_folder,
+  create_virtual_folder,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+  press_delete,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 /**
  * Add some messages to a folder, delete the first one, and create a saved
  * search over the inbox and the folder. Then, compact folders.
  */
 function test_setup_virtual_folder_and_compact() {
   let otherFolder = create_folder("otherFolder");
   make_new_sets_in_folder(otherFolder, [{ count: 2 }]);
--- a/mail/test/mozmill/folder-display/test-selection.js
+++ b/mail/test/mozmill/folder-display/test-selection.js
@@ -1,28 +1,48 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-selection";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  assert_visible,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  delete_via_popup,
+  enter_folder,
+  make_display_grouped,
+  make_display_threaded,
+  make_display_unthreaded,
+  make_new_sets_in_folder,
+  make_new_sets_in_folders,
+  mc,
+  open_folder_in_new_tab,
+  press_delete,
+  right_click_on_row,
+  select_click_row,
+  select_column_click_row,
+  select_control_click_row,
+  select_none,
+  select_shift_click_row,
+  switch_tab,
+  wait_for_blank_content_pane,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 // let us have 2 folders
 var folder = null,
   folder2 = null;
 
 var setupModule = function(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folder = create_folder("SelectionA");
   folder2 = create_folder("SelectionB");
   make_new_sets_in_folders([folder, folder2], [{ count: 50 }]);
 };
 
 // https://bugzilla.mozilla.org/show_bug.cgi?id=474701#c80
 function test_selection_on_entry() {
   enter_folder(folder);
--- a/mail/test/mozmill/folder-display/test-summarization.js
+++ b/mail/test/mozmill/folder-display/test-summarization.js
@@ -14,32 +14,60 @@
  *  tab tests may do the same thing too...)
  *
  * Things we don't test but should:
  * - The difference between thread summary and multi-message summary.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var { ensure_card_exists, ensure_no_card_exists } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var {
+  add_sets_to_folders,
+  assert_collapsed,
+  assert_expanded,
+  assert_messages_summarized,
+  assert_nothing_selected,
+  assert_selected,
+  assert_selected_and_displayed,
+  assert_summary_contains_N_elts,
+  be_in_folder,
+  close_tab,
+  collapse_all_threads,
+  create_folder,
+  create_thread,
+  create_virtual_folder,
+  make_display_threaded,
+  make_new_sets_in_folders,
+  mc,
+  open_folder_in_new_tab,
+  open_selected_message_in_new_tab,
+  plan_to_wait_for_folder_events,
+  select_click_row,
+  select_control_click_row,
+  select_none,
+  select_shift_click_row,
+  switch_tab,
+  toggle_thread_row,
+  wait_for_blank_content_pane,
+  wait_for_folder_events,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-summarization";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var folder;
 var thread1, thread2, msg1, msg2;
 
 var setupModule = function(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let abh = collector.getModule("address-book-helpers");
-  abh.installInto(module);
-
   folder = create_folder("SummarizationA");
   thread1 = create_thread(10);
   msg1 = create_thread(1);
   thread2 = create_thread(10);
   msg2 = create_thread(1);
   add_sets_to_folders([folder], [thread1, msg1, thread2, msg2]);
 };
 
--- a/mail/test/mozmill/folder-display/test-tabs-simple.js
+++ b/mail/test/mozmill/folder-display/test-tabs-simple.js
@@ -8,28 +8,43 @@
  * transitions at one point; I (asuth) am changing our test infrastructure to
  * cause more realistic focus changes so those changes now look sillier
  * because in many cases we are explicitly setting focus back after the thread
  * tree gains focus.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-tabs-simple";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_folder_tree_focused,
+  assert_message_pane_focused,
+  assert_messages_in_view,
+  assert_nothing_selected,
+  assert_selected_and_displayed,
+  assert_thread_tree_focused,
+  be_in_folder,
+  close_tab,
+  create_folder,
+  focus_folder_tree,
+  focus_message_pane,
+  focus_thread_tree,
+  make_new_sets_in_folder,
+  mc,
+  open_folder_in_new_tab,
+  open_selected_message_in_new_tab,
+  select_click_row,
+  switch_tab,
+  wait_for_blank_content_pane,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folderA, folderB, setA, setB;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   folderA = create_folder("TabsSimpleA");
   folderB = create_folder("TabsSimpleB");
 
   // We will verify we are seeing the right folder by checking that it has the
   //  right messages in it.
   [setA] = make_new_sets_in_folder(folderA, [{}]);
   [setB] = make_new_sets_in_folder(folderB, [{}]);
 }
--- a/mail/test/mozmill/folder-display/test-virtual-folder-commands.js
+++ b/mail/test/mozmill/folder-display/test-virtual-folder-commands.js
@@ -3,30 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that commands on virtual folders work properly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-virtual-folder-commands";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_true,
+  be_in_folder,
+  expand_all_threads,
+  make_display_threaded,
+  make_folder_with_sets,
+  make_virtual_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var msgsPerThread = 5;
 var singleVirtFolder;
 var multiVirtFolder;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   let [folderOne] = make_folder_with_sets([{ msgsPerThread }]);
   let [folderTwo] = make_folder_with_sets([{ msgsPerThread }]);
 
   singleVirtFolder = make_virtual_folder([folderOne], {});
   multiVirtFolder = make_virtual_folder([folderOne, folderTwo], {});
 }
 
 function test_single_folder_select_thread() {
--- a/mail/test/mozmill/folder-display/test-watch-ignore-thread.js
+++ b/mail/test/mozmill/folder-display/test-watch-ignore-thread.js
@@ -3,28 +3,37 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that "watch thread" and "ignore thread" works correctly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-watch-ignore-thread";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  add_sets_to_folders,
+  assert_not_shown,
+  assert_selected_and_displayed,
+  assert_visible,
+  be_in_folder,
+  create_folder,
+  create_thread,
+  expand_all_threads,
+  inboxFolder,
+  make_display_threaded,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 var thread1, thread2, thread3;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-
   folder = create_folder("WatchIgnoreThreadTest");
   thread1 = create_thread(3);
   thread2 = create_thread(4);
   thread3 = create_thread(5);
   add_sets_to_folders([folder], [thread1, thread2, thread3]);
 
   be_in_folder(folder);
   make_display_threaded();
--- a/mail/test/mozmill/folder-pane/test-display-message-with-folder-modes.js
+++ b/mail/test/mozmill/folder-pane/test-display-message-with-folder-modes.js
@@ -9,32 +9,47 @@
  *   current folder mode
  * - not switching otherwise
  * - making sure that we're able to expand the right folders in the smart folder
  *   mode
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-display-message-with-folder-modes";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_folder_child_in_view,
+  assert_folder_collapsed,
+  assert_folder_expanded,
+  assert_folder_mode,
+  assert_folder_not_visible,
+  assert_folder_selected_and_displayed,
+  assert_folder_tree_view_row_count,
+  assert_folder_visible,
+  assert_message_not_in_view,
+  assert_selected_and_displayed,
+  be_in_folder,
+  collapse_folder,
+  display_message_in_folder_tab,
+  get_smart_folder_named,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+  select_none,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var folder;
 var dummyFolder;
 var inbox2Folder;
 var smartInboxFolder;
 
 var msgHdr;
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-
   assert_folder_mode("all");
   assert_folder_tree_view_row_count(7);
 
   // This is a subfolder of the inbox so that
   // test_display_message_in_smart_folder_mode_works is able to test that we
   // don't attempt to expand any inboxes.
   inboxFolder.createSubfolder("DisplayMessageWithFolderModesA", null);
   folder = inboxFolder.getChildNamed("DisplayMessageWithFolderModesA");
--- a/mail/test/mozmill/folder-pane/test-folder-names-in-recent-mode.js
+++ b/mail/test/mozmill/folder-pane/test-folder-names-in-recent-mode.js
@@ -3,29 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Test that the folder names have account name appended when in "recent" view.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  assert_folder_at_index_as,
+  assert_folder_mode,
+  assert_folder_tree_view_row_count,
+  make_new_sets_in_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
-var MODULE_NAME = "test-folder-names-in-recent-mode";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 var { fixIterator } = ChromeUtils.import(
   "resource:///modules/iteratorUtils.jsm"
 );
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-
   assert_folder_mode("all");
   assert_folder_tree_view_row_count(7);
 }
 
 function test_folder_names_in_recent_view_mode() {
   // We need 2 local accounts that have pristine folders with
   // unmodified times, so that it does not influence the
   // list of Recent folders. So clear out the most-recently-used time.
--- a/mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
+++ b/mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
@@ -3,38 +3,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests for other dialogs using the tree view implementation in folderPane.js.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-nntp-helpers.js */
-
-var MODULE_NAME = "test-folder-pane";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "nntp-helpers"];
-
+var { assert_true, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var { NNTP_PORT, setupLocalServer } = ChromeUtils.import(
+  "resource://testing-common/mozmill/NNTPHelpers.jsm"
+);
 var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
   "resource://testing-common/mozmill/WindowHelpers.jsm"
 );
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var nntpAccount;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   let server = setupLocalServer(NNTP_PORT);
   nntpAccount = MailServices.accounts.FindAccountForServer(server);
 }
 
 function test_virtual_folder_selection_tree() {
   plan_for_modal_dialog(
     "mailnews:virtualFolderProperties",
     subtest_create_virtual_folder
--- a/mail/test/mozmill/folder-pane/test-folder-pane.js
+++ b/mail/test/mozmill/folder-pane/test-folder-pane.js
@@ -5,31 +5,35 @@
 /*
  * Tests for the folder pane, in particular the tree view. This is kept separate
  * from the main folder-display suite so that the folders created by other tests
  * there don't influence the results here.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-folder-pane";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  FAKE_SERVER_HOSTNAME,
+  assert_folder_mode,
+  assert_folder_tree_view_row_count,
+  be_in_folder,
+  collapse_folder,
+  create_folder,
+  enter_folder,
+  expand_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
-function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-}
-
 /**
  * Assert the Folder Pane is in All Folder mode by default.  Check that the
  * correct number of rows for accounts and folders are always shown as new
  * folders are created, expanded, and collapsed.
  */
 function test_all_folders_toggle_folder_open_state() {
   // Test that we are in All Folders mode by default
   assert_folder_mode("all");
--- a/mail/test/mozmill/folder-tree-modes/test-custom-folder-tree-mode.js
+++ b/mail/test/mozmill/folder-tree-modes/test-custom-folder-tree-mode.js
@@ -5,35 +5,38 @@
 
 /*
  * Tests for custom folder tree modes. The test mode is provided by the test
  * extension in the test-extension subdirectory.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-custom-folder-tree-mode";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
+var {
+  assert_folder_mode,
+  assert_folder_visible,
+  FAKE_SERVER_HOSTNAME,
+  get_special_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var {
   close_window,
   plan_for_new_window,
   wait_for_new_window,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+
 var gInbox;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   gInbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
 }
 
--- a/mail/test/mozmill/folder-tree-modes/test-custom-smart-folder.js
+++ b/mail/test/mozmill/folder-tree-modes/test-custom-smart-folder.js
@@ -5,21 +5,33 @@
 
 /*
  * Tests for custom folder tree modes. The test mode is provided by the test
  * extension in the test-extension subdirectory.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-custom-smart-folder";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_folder_collapsed,
+  assert_folder_displayed,
+  assert_folder_expanded,
+  assert_folder_mode,
+  assert_folder_not_visible,
+  assert_folder_selected_and_displayed,
+  assert_folder_visible,
+  collapse_folder,
+  expand_folder,
+  get_smart_folder_named,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 // spaces in the name are intentional
 var smartParentNameA = "My Smart Folder A";
 var smartParentNameB = "My Smart Folder B";
 
 var rootFolder;
 var inboxSubfolder, subfolderA, subfolderB;
 var smartFolderInbox;
@@ -27,19 +39,16 @@ var smartFolderA;
 
 var nsMsgFolderFlags = Ci.nsMsgFolderFlags;
 
 /**
  * create two smart folder types and two real folders, one for each
  * smart folder type
  */
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   rootFolder = inboxFolder.server.rootFolder;
 
   // register a new smart folder type
   mc.folderTreeView
     .getFolderTreeMode("smart")
     .addSmartFolderType(smartParentNameA, false, false);
   mc.folderTreeView
     .getFolderTreeMode("smart")
--- a/mail/test/mozmill/folder-tree-modes/test-mode-switching.js
+++ b/mail/test/mozmill/folder-tree-modes/test-mode-switching.js
@@ -5,42 +5,45 @@
 /*
  * Bug 978592.
  * Test that switching folder modes via menu works and also compact versions
  * can be toggled properly.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-mode-switching";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_equals,
+  assert_folder_not_visible,
+  assert_folder_visible,
+  assert_true,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+  select_no_folders,
+  toggle_main_menu,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var rootFolder;
-var inboxFolder;
 var unreadFolder;
 var favoriteFolder;
 var toggle_menu;
 var toggle_appmenu;
 var tree;
 var modeList_menu;
 var modeList_appmenu;
 var view_menu;
 var view_menupopup;
 var appmenu_button;
 var appmenu_mainView;
 var menu_state;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   rootFolder = inboxFolder.server.rootFolder;
 
   // Create one folder with unread messages and one favorite folder.
   inboxFolder.createSubfolder("UnreadFolder", null);
   unreadFolder = inboxFolder.getChildNamed("UnreadFolder");
 
   inboxFolder.createSubfolder("FavoriteFolder", null);
   favoriteFolder = inboxFolder.getChildNamed("FavoriteFolder");
--- a/mail/test/mozmill/folder-tree-modes/test-smart-folders.js
+++ b/mail/test/mozmill/folder-tree-modes/test-smart-folders.js
@@ -5,39 +5,54 @@
 /*
  * Test that the smart folder mode works properly. This includes checking
  * whether |getParentOfFolder| works, and also making sure selectFolder behaves
  * properly, opening the right folders.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var {
+  archive_selected_messages,
+  assert_folder_child_in_view,
+  assert_folder_collapsed,
+  assert_folder_expanded,
+  assert_folder_selected_and_displayed,
+  be_in_folder,
+  collapse_folder,
+  delete_message_set,
+  expand_folder,
+  FAKE_SERVER_HOSTNAME,
+  get_smart_folder_named,
+  get_special_folder,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+  select_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { fixIterator } = ChromeUtils.import(
   "resource:///modules/iteratorUtils.jsm"
 );
-
-var MODULE_NAME = "test-smart-folders";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var rootFolder;
 var inboxSubfolder;
 var trashFolder;
 var trashSubfolder;
 
 var smartInboxFolder;
 
 var inboxSet;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   rootFolder = inboxFolder.server.rootFolder;
 
   // Create a folder as a subfolder of the inbox
   inboxFolder.createSubfolder("SmartFoldersA", null);
   inboxSubfolder = inboxFolder.getChildNamed("SmartFoldersA");
 
   trashFolder = inboxFolder.server.rootFolder.getFolderWithFlags(
     Ci.nsMsgFolderFlags.Trash
--- a/mail/test/mozmill/folder-tree-modes/test-unread-folders.js
+++ b/mail/test/mozmill/folder-tree-modes/test-unread-folders.js
@@ -5,32 +5,34 @@
 /*
  * Test that the unread folder mode works properly. This includes making
  * sure that the selected folder is maintained correctly when the view
  * is rebuilt because a folder has become newly unread.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-unread-folders";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_folder_visible,
+  be_in_folder,
+  delete_message_set,
+  inboxFolder,
+  make_new_sets_in_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var rootFolder;
 var inboxSubfolder;
 var trashFolder;
 var trashSubfolder;
 var inboxSet;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-
   rootFolder = inboxFolder.server.rootFolder;
 
   // Create a folder as a subfolder of the inbox
   inboxFolder.createSubfolder("UnreadFoldersA", null);
   inboxSubfolder = inboxFolder.getChildNamed("UnreadFoldersA");
 
   trashFolder = inboxFolder.server.rootFolder.getFolderWithFlags(
     Ci.nsMsgFolderFlags.Trash
@@ -82,9 +84,10 @@ function test_newly_added_folder() {
   }
   delete_message_set(newSet);
 }
 
 function teardownModule() {
   inboxFolder.propagateDelete(inboxSubfolder, true, null);
   delete_message_set(inboxSet);
   trashFolder.propagateDelete(trashSubfolder, true, null);
+  mc.folderTreeView.mode = "all";
 }
--- a/mail/test/mozmill/folder-widget/test-message-filters.js
+++ b/mail/test/mozmill/folder-widget/test-message-filters.js
@@ -3,55 +3,60 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test various properties of the message filters.
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-nntp-helpers.js */
-
-var MODULE_NAME = "test-message-filters";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "nntp-helpers",
-  "address-book-helpers",
-];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var { create_ldap_address_book } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
+);
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_true,
+  be_in_folder,
+  close_popup,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var { NNTP_PORT, setupLocalServer, setupNNTPDaemon } = ChromeUtils.import(
+  "resource://testing-common/mozmill/NNTPHelpers.jsm"
+);
 var {
   close_window,
   plan_for_modal_dialog,
   plan_for_new_window,
   plan_for_window_close,
   wait_for_existing_window,
   wait_for_modal_dialog,
   wait_for_new_window,
   wait_for_window_focused,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var { gMockPromptService } = ChromeUtils.import(
   "resource://testing-common/mozmill/PromptHelpers.jsm"
 );
 
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 var folderA;
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   setupNNTPDaemon();
 
   folderA = create_folder("FolderToolbarA");
   // we need one message to select and open
   make_new_sets_in_folder(folderA, [{ count: 1 }]);
 
   setupLocalServer(NNTP_PORT);
 }
--- a/mail/test/mozmill/im/test-chat-tab-restore.js
+++ b/mail/test/mozmill/im/test-chat-tab-restore.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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
-var MODULE_NAME = "test-chat-tab-restore";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var { assert_tab_mode_name, mark_action, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 /**
  * Create a new chat tab, making that tab the current tab. We block until the
  * message finishes loading. (Inspired by open_selected_message_in_new_tab)
  */
 function open_chat_tab() {
   // Get the current tab count so we can make sure the tab actually opened.
   let preCount = mc.tabmail.tabContainer.allTabs.length;
@@ -53,20 +53,16 @@ function wait_for_chat_tab_to_open(aCont
   );
 
   // The above may return immediately, meaning the event queue might not get a
   // chance. Give it a chance now.
   aController.sleep(0);
   mark_action("imh", "/wait_for_chat_tab_to_open", []);
 }
 
-function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-}
-
 /*
  * This tests that the chat tab is restored properly after tabs are
  * serialized. As for folder tabs, we can't test a restart (can we ?), so we
  * just test the persist/restore cycle.
  */
 function test_chat_tab_restore() {
   // Close everything but the first tab.
   let closeTabs = function() {
@@ -83,9 +79,11 @@ function test_chat_tab_restore() {
   if (mc.tabmail.tabContainer.allTabs.length < 2) {
     throw new Error("The tab is not restored!");
   }
 
   let tabTypes = ["folder", "chat"];
   for (let i in tabTypes) {
     assert_tab_mode_name(mc.tabmail.tabInfo[i], tabTypes[i]);
   }
+
+  closeTabs();
 }
--- a/mail/test/mozmill/im/test-toolbar-buttons.js
+++ b/mail/test/mozmill/im/test-toolbar-buttons.js
@@ -1,26 +1,26 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-toolbar-buttons";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_equals,
+  assert_false,
+  assert_not_equals,
+  assert_true,
+  mc,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 var { Services } = ChromeUtils.import("resource:///modules/imServices.jsm");
 
-function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
-}
-
 /* This test checks that the toolbar buttons of the chat toolbar are
  * correctly disabled/enabled, and that the placeholder displayed in
  * the middle of the chat tab is correct.
  */
 function test_toolbar_and_placeholder() {
   assert_not_equals(
     mc.tabmail.selectedTab.mode.type,
     "chat",
@@ -136,9 +136,13 @@ function test_toolbar_and_placeholder() 
     mc.e("noConnectedAccountInnerBox").hidden,
     "the 'No connected account' placeholder is visible"
   );
   assert_equals(
     chatHandler._placeHolderButtonId,
     "openIMAccountManagerButton",
     "the correct placeholder button is visible"
   );
+
+  while (mc.tabmail.tabInfo.length > 1) {
+    mc.tabmail.closeTab(1);
+  }
 }
--- a/mail/test/mozmill/instrumentation/test-instrument-setup.js
+++ b/mail/test/mozmill/instrumentation/test-instrument-setup.js
@@ -1,47 +1,43 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-instrument-setup";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var { assert_equals, mc } = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 var { input_value } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var {
   plan_for_window_close,
   wait_for_existing_window,
   wait_for_window_close,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var user = {
   name: "Roger Sterling",
   email: "roger.sterling@example.com",
   incomingHost: "testin.example.com",
   outgoingHost: "testout.example.com",
 };
 
 function setupModule(module) {
-  for (let lib of MODULE_REQUIRES) {
-    collector.getModule(lib).installInto(module);
-  }
-
   Services.prefs.setCharPref("mail.wizard.logging.dump", "All");
 
   // Set the pref to load a local autoconfig file.
   let url = collector.addHttpResource("../account/xml", "autoconfig");
   Services.prefs.setCharPref("mailnews.auto_config_url", url);
 
   // Force .com MIME-Type to text/xml
   collector.httpd.registerContentType("com", "text/xml");
--- a/mail/test/mozmill/junk-commands/test-junk-commands.js
+++ b/mail/test/mozmill/junk-commands/test-junk-commands.js
@@ -1,32 +1,35 @@
 /* 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";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-/* import-globals-from ../shared-modules/test-junk-helpers.js */
+var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
-var MODULE_NAME = "test-junk-commands";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "junk-helpers"];
-
-var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
+var {
+  be_in_folder,
+  create_folder,
+  make_new_sets_in_folder,
+  select_click_row,
+  select_none,
+  select_shift_click_row,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
+var {
+  delete_mail_marked_as_junk,
+  mark_selected_messages_as_junk,
+} = ChromeUtils.import("resource://testing-common/mozmill/JunkHelpers.jsm");
 
 // One folder's enough
 var folder = null;
 
 function setupModule(module) {
-  let fdh = collector.getModule("folder-display-helpers");
-  fdh.installInto(module);
-  let jh = collector.getModule("junk-helpers");
-  jh.installInto(module);
-
   folder = create_folder("JunkCommandsA");
   make_new_sets_in_folder(folder, [{ count: 30 }]);
 }
 
 /**
  * The number of messages to mark as junk and expect to be deleted.
  */
 var NUM_MESSAGES_TO_JUNK = 8;
--- a/mail/test/mozmill/keyboard/test-spacehit.js
+++ b/mail/test/mozmill/keyboard/test-spacehit.js
@@ -4,29 +4,35 @@
 
 /**
  * Tests that the space bar only advances to the next unread message
  * when mail.advance_on_spacebar is true (default).
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-spacehit";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers"];
+var {
+  assert_equals,
+  assert_not_equals,
+  be_in_folder,
+  create_folder,
+  make_new_sets_in_folder,
+  mc,
+  select_click_row,
+  wait_for_message_display_completion,
+} = ChromeUtils.import(
+  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
+);
 
 // Get original preference value
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var prefName = "mail.advance_on_spacebar";
 var prefValue = Services.prefs.getBoolPref(prefName);
 
 function setupModule(module) {
-  collector.getModule("folder-display-helpers").installInto(module);
   // Create four unread messages in a sample folder
   let folder = create_folder("Sample");
   make_new_sets_in_folder(folder, [{ count: 4 }]);
   be_in_folder(folder);
 }
 
 function teardownModule(module) {
   // Restore original preference value
--- a/mail/test/mozmill/message-header/test-message-header.js
+++ b/mail/test/mozmill/message-header/test-message-header.js
@@ -4,32 +4,53 @@
 
 /**
  * Test functionality in the message header, e.g. tagging, contact editing,
  * the more button ...
  */
 
 "use strict";
 
-/* import-globals-from ../shared-modules/test-address-book-helpers.js */
-/* import-globals-from ../shared-modules/test-dom-helpers.js */
-/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
-
-var MODULE_NAME = "test-message-header";
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [
-  "folder-display-helpers",
-  "address-book-helpers",
-  "dom-helpers",
-];
-
 var elib = ChromeUtils.import(
   "chrome://mozmill/content/modules/elementslib.jsm"
 );
 
+var {
+  create_address_book