Clojure-style references and transactions in JavaScript