             [secretary.core :as secretary])
   (:import goog.History))
 
-;; Link format: [[foo|blitz]]
-
+;; From http://adambard.com/blog/a-simple-clojurescript-app/
+
+(defn keywordify [m]
+  (cond
+   (map? m) (into {} (for [[k v] m] [(keyword k) (keywordify v)]))
+   (coll? m) (vec (map keywordify m))
+   :else m))
+
+(defn fetch [k default]
+  (let [item (.getItem js/localStorage k)]
+    (if  (and item (not= item "null")) ;; "null" is true, fuck you js.
+      (-> (.getItem js/localStorage k)
+          (or (js-obj))
+          (js/JSON.parse)
+          (js->clj)
+          (keywordify))
+      default)))
+
+(defn store [k obj]
+  (.setItem js/localStorage k (js/JSON.stringify (clj->js obj))))
 
 (def base-url (atom ""))
 

                   (secretary/dispatch! (.-token event))))
  (.setEnabled history true))

(defonce app-state (atom {:search ""
                          :word-map {"Ogden" [0]
                                     "Foo" [1]} ;; populate this, oh
                          :visible [] ;; XXX: Bad name, visible items.

          (if value (method app value) (method app)))))))

(defn app-view [app owner]
  ;; Can this be here?
  (store "unfolds" app) ;; too much?
  (reify
    om/IInitState
    (init-state [_]
