   (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-text [text]
  (fn -text-pred [component]
    (let [actual-text (.-textContent component)]
      (if (= text actual-text)
        true
        {:msg "Text does not match" :expected text :actual actual-text}


(defn containing [& tests]
  (fn -containing-pred [component]
    (let [children (children-of component)
          test-count (count tests)
          child-count (count children)]
      (if (not= test-count child-count)
        {:msg "Wrong number of child elements"
         :expected test-count :actual child-count
         :actual-children (display-children children)
         }
        (if-let [failures
                 (seq (filter (fn [result] (not= true result))
                              (map (fn [pred child] (pred child))
                                   tests children
                                   )))]
          failures
          true
          )
        )
      )
