 
 ;; TODO: seed cljs.core/cljs.user
 (defn global-env []
-  (atom '{:namespaces {cljs.user {:mappings       {}
-                                  :aliases        {}
-                                  :macro-mappings {}
-                                  :macro-aliases  {}
-                                  :ns             cljs.user}
-                       cljs.core {:mappings       {}
-                                  :aliases        {}
-                                  :macro-mappings {}
-                                  :macro-aliases  {}
-                                  :ns             cljs.core}}}))
+  (atom {:namespaces          '{cljs.core {:mappings       {}
+                                           :aliases        {}
+                                           :macro-mappings {}
+                                           :macro-aliases  {}
+                                           :ns             cljs.core}}
+         :js-dependency-index (deps/js-dependency-index {})}))
 
 (defn empty-env
   "Returns an empty env map"

(declare analyze-ns)
(defn ensure-loaded [ns env]
  (or (-> (env/deref-env) :namespaces ns)
      (analyze-ns ns)))

(defn core-macros []

                                    m)) {} require)
        require-mappings (reduce (fn [m [ns {:keys [refer]}]]
                                   (ensure-loaded ns env)
                                   ;; TODO: handle (:require [goog.lib :refer [things]]) ?
                                   (reduce #(assoc %1 %2 (get-in (env/deref-env)
                                                                 [:namespaces ns :mappings %2])) m refer))
                                 {} require)
