         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)

    (js/setInterval #(reset! mya (time/now)) 1000)
    mya))

(defn main [state top-level-node history-imp]
  (let [comms       (:comms @state)
        container   (sel1 top-level-node "#om-app")
        uri-path    (.getPath utils/parsed-uri)
        history-path "/"
        pusher-imp (pusher/new-pusher-instance)


(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!))
