   (config/set-config-value! :echo-rest-port 3012)
   (config/set-config-value! :echo-rest-context "/legacy-services/rest")
   (config/set-config-value! :dev-system-db-type :in-memory)
-  ;; Hard coded here and in legacy-services/echo/echo-env/support/db/bootstrap/business/system_acls_changeLog.xml
-  ;; so that ACLs that are bootstrapped in kernel reference same Administrators group in bootstrapped CMR.
+  ;; Hard coded here and here:
+  ;; * legacy-services/echo/echo-env/support/db/bootstrap/business/system_acls_changeLog.xml
+  ;; so that ACLs that are bootstrapped in kernel reference same Administrators group in
+  ;; bootstrapped CMR.
   (transmit-config/set-administrators-group-legacy-guid! "316520E041894014E050007F010038C4"))
 
 (defn start
-  "Starts the current development system."
-  []
+  "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)
   (config/reset-config-values)
 
   (jobs/set-default-job-start-delay! (* 3 3600))
 
   (system/set-gorilla-repl-port! 8090)
 
-  ;; Comment/uncomment these lines to switch between external and internal settings.
-
-  (system/set-dev-system-elastic-type! :in-memory)
-  ; (system/set-dev-system-elastic-type! :external)
-
-  ;; 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! :in-memory)
-  ; (system/set-dev-system-echo-type! :external)
-
-
-  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-  ;; 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! :in-memory)
-  ; (system/set-dev-system-db-type! :external)
-
-  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-  (system/set-dev-system-message-queue-type! :in-memory)
-  ; (system/set-dev-system-message-queue-type! :external)
-  ; (system/set-dev-system-message-queue-type! :aws)
+  (system/set-dev-system-elastic-type! elastic)
+  ;; 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)
+  ;; 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)
+  (if aws?
+    (system/set-dev-system-message-queue-type! :aws)
+    (system/set-dev-system-message-queue-type! messaging))
 
   (sit-sys/set-logging-level @settings/logging-level)
 
-  ;; Uncomment this to force CMR to use Legacy Services
-  ; (configure-for-legacy-services)
+  ;; 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
+  ;; command line option for this.
+  (when legacy?
+    (configure-for-legacy-services))
 
   (let [s (-> (system/create-system)
               (configure-systems-logging @settings/logging-level)

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

(defn set-logging-level!
  "Sets the logging level to the given setting. Puts the level in refresh-persistent-settings

                    (constantly
                      (system/start s))))

    (d/touch-user-clj))

(defn stop
  "Shuts down and destroys the current development system."
