   "Applies a seq of alternating events and intervals (in seconds) between them
   to stream, returning outputs."
   [stream inputs-and-intervals]
-  `(let [out# (ref [])
+  `(let [out# (atom [])
          stream# (~@stream (append out#))
          start-time# (ref (unix-time))
          next-time# (ref (deref start-time#))]

  "Exposes a fake index, verifies that the given stream, taking inputs,
  forwards outputs to children"
  [sym stream inputs outputs]
  `(let [out#    (ref [])
         ~sym    (append out#)
         stream# ~stream]
     (doseq [e# ~inputs] (stream# e#))

           (em 12 200)))

(deftest changed-test
         (let [output (atom [])
               r (changed :state (append output))
               r2 (changed :state {:init :ok}
                           (append output))
               states [:ok :bad :bad :ok :ok :ok :evil :bad]]

           ; Apply states
           (doseq [state states]
             (r {:state state}))
