   Parameters:
   - markup  The message to display in the modal (a string or a hiccup vector or function returning a hiccup vector)
   "
-  (reagent/create-class
-   {
-    :component-did-mount
-    (fn []
-      ;; CORE.ASYNC REMOVED
-      )
+  (fn []
+    [:div
+     {:style {:display "flex"      ;; Semi-transparent backdrop
+              :position "fixed"
+              :left "0px"
+              :top "0px"
+              :width "100%"
+              :height "100%"
+              :background-color "rgba(0,0,0,0.85)"
+              :z-index 1020
+              :on-click #(util/console-log "clicked backdrop") ;; Gobble up clicks so they don't go to the main window (TODO: Doesn't work)
+              }}
+     [:div                         ;; Modal window containing div
+      {:style {:margin "auto"
+               :background-color "white"
+               :padding "16px"
+               :border-radius "6px"
+               :z-index 1020}}
+      markup]]))
 
-    :render
-    (fn []
-      [:div
-       {:style {:display "flex"      ;; Semi-transparent backdrop
-                :position "fixed"
-                :left "0px"
-                :top "0px"
-                :width "100%"
-                :height "100%"
-                :background-color "rgba(0,0,0,0.85)"
-                :z-index 1020
-                :on-click #(util/console-log "clicked backdrop") ;; Gobble up clicks so they don't go to the main window (TODO: Doesn't work)
-                }}
-       [:div                         ;; Modal window containing div
-        {:style {:margin "auto"
-                 :background-color "white"
-                 :padding "16px"
-                 :border-radius "6px"
-                 :z-index 1020}}
-        markup]])}))
 
 
 ;; ------------------------------------------------------------------------------------
-;;  chunk-runner  TODO: TO BE REMOVED
+;;  looper
 ;; ------------------------------------------------------------------------------------
 
-(defn chunk-runner [chunk-fn status chunks]
-  "Split your long running process into bite-size chunks and use this function to schedule those execution
-  chunks into the JavaScript event loop. It will also:
-  - Manage the showing/hiding of the modal window
-  - Calculate the percentage to be used in the progress bar if that's being shown
-  Parameters:
-  - chunk-fn  Your function that will be repeatedly called to perform a single chunk of processing.
-  .           It will be passed the following parameters:
-  .            - chunk-index  Chunk number 0 to chunks - 1
-  .            - chunks       Number of chucks to be processed [TODO: Would we ever really need this?]
-  .            - percent      Percentage through the process, rounded to nearest integer. This is important
-  .                           as chunk-fn is responsible for updating the atom holding the percentage progress
-  .                           used by the progress bar
-  - status    The atom used to indicate the process is running (:running, :finished, :cancelled) and that
-  .           the modal should be shown
-  - chunks    How many times chunk-fn should be called (if omitted, defaults to 1)
-  "
-  (let [chunks (if chunks chunks 1)]
-    (util/console-log (str "STARTING chunk-runner (" chunks ")"))
-    (reset! modal-alert nil) ;; Clea any previous alerts
-    (reset! status :running)   ;; Start by showing the modal
-    (loop [chunk-index 0]
-      (if (< chunk-index chunks)
-        (let [percent (int (+ (* (/ chunk-index (- chunks 1)) 100) 0.5))] ;; OR: (-> chunk-index (/ (- chunks 1)) (* 100) (+ 0.5) int)
-          (js/setTimeout #(chunk-fn chunk-index chunks percent) 0) ;; Schedule each chunk of work
-          (recur (inc chunk-index)))
-        (js/setTimeout #(reset! status :finished) 0)) ;; Schedule closing the modal window
-      ))
-  (util/console-log "FINISHED chunk-runner"))
-
-
-(defn start-cpu-intensive
-  [func]
-  "Run a CPU intensive function with a slight delay to allow the UI to updated (and show modal window changes)
-  "
-  (js/setTimeout func 10))
-
-
-;; ------------------------------------------------------------------------------------
-;;  modal-multi-chunk-runner   TODO: TO BE REMOVED
-;; ------------------------------------------------------------------------------------
-
-(defn modal-multi-chunk-runner
-  [func initial-state running?]
+(defn looper
+  [& {:keys [initial-value func when-done]}]
   "...
   Parameters:
   - func           A function to repeatedly call. On each call, something else happens, could be the

  .                to be used for the subsequent function call and so on.
  - running?       A reagent boolean atom indicating if the processing is running
  "
  (let [schedule (fn reschedule [state]
                   (js/setTimeout
                    #(let [next-state (apply (func) state)]
                       (util/console-log (str "IN reschedule: " state))
                       (when-not next-state (reset! running? false))
                       (when @running? (reschedule next-state)))
                    20))] ;; 20ms should give enough time for UI events to be processed
    (reset! running? true)
    (schedule initial-state)))


;; ------------------------------------------------------------------------------------
;;  looper
;; ------------------------------------------------------------------------------------

(defn looper
  [& {:keys [initial-value func when-done]}]
  (go (loop [pause (<! (timeout 20))
             val   initial-value]
        (let [[continue? out]  (func val)]

            (recur (<! (timeout 20)) out)
            (when-done out))))))



;; ------------------------------------------------------------------------------------
