   (transmit-config/set-administrators-group-legacy-guid! "316520E041894014E050007F010038C4"))
 
 (defn start
-  "Starts the current development system, taking the following optional
-  keyword arguments, where `VALUE` is any alowed run mode:
-
-  * `:elastic VALUE`
-  * `:echo VALUE`
-  * `:db VALUE`
-  * `:messaging VALUE`
-
-  If a run mode for a particular component is not passed, its value is set to
-  the global run mode. If no mode has been set, the ns-level `mode` variable
-  will be set to `:in-memory`.
-
-  Note that when an explicit mode is passed as an argument, not only will CMR
-  be started in that mode, but the ns-level `user/mode` variable will be reset
-  to the given value."
-  [& {:keys [elastic echo db messaging]
-       :or {elastic mode} {echo mode} {db mode} {messaging mode}}]
-  (set-mode! new-mode)
+  "Starts the current development system, taking optional keyword arguments for
+  various run modes (see the docstring for `set-modes!` for more details).
+
+  Note that when one or more explicit modes are passed as arguments, the global
+  `run-modes` data structure is updated.
+
+  If a run mode for a particular component is not passed, its value taken from
+  what is already in the `run-modes` global data structure. If no mode has been
+  set, the default from initialization will be used."
+  ;; Note that even through the named args are not used, they are provided as
+  ;; a means of self-documentation.
+  [& {:keys [elastic echo db messaging] :as new-modes}]
+  (when-not (empty? new-modes)
+    (apply set-modes! (mapcat seq new-modes)))
   (config/reset-config-values)
 
   (jobs/set-default-job-start-delay! (* 3 3600))
 
   (system/set-gorilla-repl-port! 8090)
 
-  (system/set-dev-system-elastic-type! elastic)
+  (system/set-dev-system-elastic-type! (:elastic run-modes))
   ;; NOTE: External ECHO does not work with the automated tests. The automated
   ;; tests expect they can interact with the Mock ECHO to setup users, acls,
   ;; and other ECHO objects.
-  (system/set-dev-system-echo-type! echo)
+  (system/set-dev-system-echo-type! (:echo run-modes))
   ;; IMPORTANT: MAKE SURE YOU DISABLE SYMANTEC ANTIVIRUS BEFORE STARTING THE
-  ;; TESTS WITH EXTERNAL DB (renable them when you're done)
-  (system/set-dev-system-db-type! db)
+  ;; TESTS WITH EXTERNAL DB (re-enable them when you're done)
+  (system/set-dev-system-db-type! (:db run-modes))
+  ;; If you would like to run CMR with :aws instead of :in-memory or :external,
+  ;; be sure to call `(set-aws true)` in the REPL.
   (if aws?
     (system/set-dev-system-message-queue-type! :aws)
-    (system/set-dev-system-message-queue-type! messaging))
+    (system/set-dev-system-message-queue-type! (:messaging run-modes)))
 
   (sit-sys/set-logging-level @settings/logging-level)
 
   ;; If you would like to run CMR with legacy support, then be sure to call
-  ;; `(use-legacy true)` in the REPL. There is currently no lein profile or
+  ;; `(set-legacy true)` in the REPL. There is currently no lein profile or
   ;; command line option for this.
   (when legacy?
     (configure-for-legacy-services))

          (fn [app-map]
            (u/map-values #(assoc-in % [:log :level] level) app-map))))

(defn set-mode!
  "Set the mode to use when starting/resetting. Valid options are:

  * :in-memory
  * :external"
  [new-mode]
  (alter-var-root #'mode (constantly new-mode)))

(defn use-legacy?
  "Passing `true` to this function will cause legacy configuration to be used
  during starts/resets."
  [bool]
  (alter-var-root #'legacy? (constantly bool)))

(defn use-aws?
  "Passing `true` to this function will cause AWS queues to be used during
  starts/resets."
  [bool]

                    (when s (system/stop s)))))

(defn reset
  "Resets the development environment, taking optional keyword arguments for
  various run modes (see the docstring for `set-modes!` for more details).
  Environment resetting includes the reloading of any changed namespaces and
  the restarting the CMR services.

  Note that when one or more explicit modes are passed as arguments, the global
  `run-modes` data structure is updated.

  If a run mode for a particular component is not passed, its value taken from
  what is already in the `run-modes` global data structure. If no mode has been
  set, the default from initialization will be used."
  ;; Note that even through the named args are not used, they are provided as
  ;; a means of self-documentation.
  [& {:keys [elastic echo db messaging] :as new-modes}]
  (when-not (empty? new-modes)
    (apply set-modes! (mapcat seq new-modes)))
  ;; Stop the system integration test system
  (sit-sys/stop)
  ; Stops the running code
  (stop)
  ; Refreshes all of the code and then restarts the system
  (refresh :after 'user/start))

(defn run-all-tests-future
  "Runs all tests asynchronously, with :fail-fast? and :speak? enabled."
