Clojure term rewriting system