         ws-tap (chan)
         errors-tap (chan)]
     (routes/define-routes! state)
-    (om/root
-     app/app
-     state
-     {:target container
-      :shared {:comms comms
-               :timer-atom (setup-timer-atom)
-               :_app-state-do-not-use state}})
+    (install-om state container)
 
     (async/tap (:controls-mult comms) controls-tap)
     (async/tap (:nav-mult comms) nav-tap)

(defn ^:export setup! []
  (apply-app-id-hack)
  (let [state (app-state)
        top-level-node (sel1 :body)
        history-imp (history/new-history-imp top-level-node)]
    ;; globally define the state so that we can get to it for debugging
    (def debug-state state)


(defn ^:export toggle-admin []
  (swap! debug-state update-in [:current-user :admin] not))

(defn reinstall-om! []
  (install-om debug-state (find-app-container (find-top-level-node))))

(defn refresh-css! []
  (let [link (.createElement js/document "link")]
    (.setAttribute link "rel" "stylesheet")
    (.setAttribute link "href" "/assets/css/app.css.less")
    (.appendChild (.-head js/document) link)))

(defn update-ui! []
  (reinstall-om!)
  (refresh-css!))
