   (apply dom/select #js {:id "client"}
          (map (fn [client-addr]
                 (dom/option #js {:value client-addr} (str client-addr)))
-              (keys (:clients (:prog-world app))))))
+              (keys (:clients (:prog-peers app))))))
 
 (defn init-roots []
   (om/root render-world run-world

; --------------------------------------------

(defn kv-server [server-addr & ports]
  (let [prog-world (:prog-world @prog-history)
        world (:world prog-world)
        done (atom false)]
    (act server-init world
         (doseq [port ports]
           (when-let [listen-result-ch (achan server-init)]
             (aput server-init (:net-listen-ch prog-world)
                   [server-addr port listen-result-ch])
             (when-let [[accept-ch close-accept-ch] (atake server-init listen-result-ch)]
               (cbfg.world.net/server-accept-loop world accept-ch close-accept-ch)
               (swap! prog-history
                      #(let [ph (update-in % [:prog-world :servers server-addr]
                                           conj port)]
                         (update-in ph [:prog-events] conj
                                    [(count (:prog-events ph))
                                     :event
                                     (:prog-world ph)]))))))
         (reset! done true))
    (wait-done done)))

(defn kv-client [client-addr server-addr server-port]
  (let [prog-world (:prog-world @prog-history)
        world (:world prog-world)
        done (atom false)]
    (act client-init world
         (let [req-ch (cbfg.world.net/client-loop world (:net-connect-ch prog-world)
                                                  server-addr server-port
                                                  client-addr (:res-ch prog-world))]
           (swap! prog-history
                  #(let [ph (assoc-in % [:prog-world :clients client-addr]
                                      {:client-addr client-addr
                                       :server-addr server-addr
                                       :server-port server-port

                     (update-in ph [:prog-events] conj
                                [(count (:prog-events ph))
                                 :event
                                 (:prog-peers ph)]))))
           (reset! done true))
    (wait-done done)))
