     om/IWillMount
     (will-mount [_]
       (om/set-state! owner [:current-save-slot] 0)
-      (om/set-state! owner [:tool] :states)
+      (om/set-state! owner [:tool] :components)
       (om/set-state! owner [:current-query] "default")
-      (om/set-state! owner [:open?] false)
+      (om/set-state! owner [:open?] true)
       (om/set-state! owner [:query] (or (:expressions opts) [])))
     om/IDidUpdate
     (did-update [_ _ prev]
-      (let [node        (om/get-node owner)
-            editor-node (.querySelector node ".editor")
+      (let [node                (om/get-node owner)
+            editor-node         (.querySelector node ".editor")
             switched-to-editor? (and (not= :debugger (:tool prev))
                                      (= :debugger (om/get-state owner [:tool])))]
         (when (and switched-to-editor? editor-node)

            [cljs.reader :as reader]
            [clojure.string :as string]
            [dato.lib.core :as dato]
            [dato.debug.components.keyboard-listener :as keyboard]
            [om-bootstrap.panel :as bs-p]
            [om-bootstrap.grid :as g]
            [om.core :as om :include-macros true]

                        :ns      'dato.debug}
                    cb))))

(defn state-watcher-coms [state-watchers]
  (keys (dissoc state-watchers ::count)))

(defn com-owner [state-watchers com-key]
  (get-in state-watchers [com-key :owner]))

(defn com-state [state-watchers com]
  (get-in state-watchers [com :states]))

(defn com-name [state-watchers com]
  (when com
    (get-in state-watchers [com :name])))

(def state-watchers
  (atom {::count 0}))

(defn com-key [com]
  (om/react-id com))

(defn watch-state-did-mount [f]
  (fn []
    (this-as
     this
     (swap! state-watchers
            (fn [s]
              (let [com-id (com-key this)]
                (-> s
                    (update-in [::count] inc)
                    (assoc-in [com-id :name] ((or (aget this "getDisplayName") (fn [] "Unknown"))))
                    (assoc-in [com-id :owner] this)))))
     (.call f this))))

(defn watch-state-did-update [f]
  (fn [prev-props prev-state]
    (this-as
     this
     (swap! state-watchers
            (fn [s]
              (let [com-id (com-key this)]
                (-> s
                    (assoc-in [com-id :states :dato] (dato/get-state this))
                    (assoc-in [com-id :states :om] (om/get-state this))))))
     (.call f this prev-props prev-state))))

(defn watch-state-will-unmount [f]
  (fn []
    (this-as
     this
     (swap! state-watchers
            (fn [s]
              (let [com-id (com-key this)]
                (-> s
                    (dissoc com-id)))))
     (.call f this))))

(defn wrap-watch-state-methods [methods]
  (-> methods
      (update-in [:componentDidMount] watch-state-did-mount)
      (update-in [:componentDidUpdate] watch-state-did-update)
      (update-in [:componentWillUnmount] watch-state-will-unmount)))

(def watch-state-methods
  (om/specify-state-methods!
   (-> om/pure-methods
       (wrap-watch-state-methods)
       (clj->js))))

(defn highlight-node! [node]
  (gclass/add node "dato-inspected"))

(defn unhighlight-node! [node]
  (gclass/remove node "dato-inspected"))

(defn history-com [data owner opts]
  (reify
    om/IDisplayName
