    logic and generates the `:navigation` and `:layout` props
    based on the active screen."
   [{:keys [default-screen reconciler root
-           root-js? target]
+           root-js? target screen-mounted]
     :or   {root-js? false}}]
   (set-root-component! root root-js?)
-  (reify IApplication
-    (mount [this]
-      (om/add-root! reconciler RootWrapper target))
-    (start [this]
-      (mount this)
-      (sb/router {:default-screen default-screen
-                  :mount-screen (partial mount-screen reconciler)}))
-    (reload [this]
-      (reload-active-screen!)
-      (mount this)
-      (let [{:keys [screen params]} (active-screen)]
-        (mount-screen reconciler screen params)))))
+  (map->Application {:config {:default-screen default-screen
+                              :reconciler reconciler
+                              :target target
+                              :screen-mounted screen-mounted}}))

                                 [])})
                        (:layout screen))}]}]]
    (set-active-screen! screen params)
    (om/set-query! app {:params params :query query})))

;;;; Application bootstrapping

(defprotocol IApplication
  (mount [this])
  (start [this])
  (reload [this]))

(defn application
  "Creates an Om Next application that implements screen-based

   all returned views with their props / query results."
  [layout]
  (zipmap (keys layout)
          (map (fn [{:keys [view props] :as item}]
                 (view (vary-meta props assoc :om-path
                                  (-> item meta :om-path))))
               (vals layout))))

(defview RootWrapper
