   (apply t/do-report args)
   )
 
+(defn component-name [component]
+  ;; component is a function; this isn't really standardized JS, but
+  ;; it works in most browsers anyway.
+  (.-name component)
+  )
+
+(defn -sub-component [data owner]
+  (reify
+    om/IRender
+    (render [this]
+      (dom/div #js {:className "huh-sub-component"})
+      )
+    )
+  )
+
 (defn -instrument [sub-component cursor m]
-  (dom/div #js {:data-huh-sub-component sub-component
-                :data-huh-cursor (.stringify js/JSON cursor)
-                :data-huh-m (.stringify js/JSON m)})
+  (om/build* -sub-component
+             {}
+             {:init-state
+              {:sub-component sub-component
+               :cursor cursor
+               :m m}
+              })
   )
 
 (defn decode-sub-component [sub-component]
-  {:sub-component (js/eval (str "("
-                                (.getAttribute sub-component
-                                               "data-huh-sub-component")
-                                ")"))
-   :cursor (.parse js/JSON (.getAttribute sub-component "data-huh-cursor"))
-   :m (.parse js/JSON (.getAttribute sub-component "data-huh-m"))}
+  (let [state (om/get-state sub-component)]
+    {
+     :sub-component (:sub-component state)
+     :cursor @(:cursor state)
+     :m (:m state)
+     }
+    )
+  )
+
+(defn sub-component? [component]
+  (= (.. component -props -className))
   )
 
 (defn test-predicates


(defn with-class [class-name]
  (fn -with-class-pred [component]
    (let [actual (.. component -className)]
      (if (.contains (.. component -classList) class-name)
        true
        {:msg "Class name does not match" :expected class-name :actual actual}

    )
  )

(defn after-event [event-attr event-arg dom-node callback]
  ((aget js/React.addons.TestUtils.Simulate (name event-attr))
   dom-node event-arg)
  (callback dom-node)
  )
