   (reset! u/error nil)
   (reset! u/out nil)
   (let [writer (StringWriter.)
-        sb (create-sandbox)]
+        sb (create-sandbox @u/project-dir)]
     (-> (io/file path)
         safe-read
         (sb {#'*out* writer})

                               play-clj.utils])
   (jail-test/blanket "clojail" "nightcode")])

(def context
  (memoize (fn [path]
             (-> (doto (jvm/permissions)
                   (.add (FilePermission. "<<ALL FILES>>" "read"))
                   (.add (-> (io/file path)
                             .getCanonicalPath
                             (str File/separatorChar "*")
                             (FilePermission. "write")))
                   (.add (ReflectPermission. "suppressAccessChecks"))
                   (.add (SocketPermission. "play-clj.net" "connect")))
                 jvm/domain
                 jvm/context))))

(defn create-sandbox
  []
  (jail/sandbox tester
                :context (context @u/project-dir)
                :timeout u/timeout
                :namespace u/game-ns
                :max-defs Integer/MAX_VALUE
                :init '(require '[nightmod.game :refer :all]
                                '[play-clj.core :refer :all]
                                '[play-clj.g2d :refer :all]
                                '[play-clj.g3d :refer :all]
                                '[play-clj.math :refer :all]
                                '[play-clj.net :refer :all]
                                '[play-clj.physics :refer :all]
                                '[play-clj.ui :refer :all])))

(defn safe-read
  [f]

  [func]
  (binding [*out* (StringWriter.)]
    (try
      (jvm/jvm-sandbox func (create-context @u/project-dir))
      (catch Throwable e
        (when-not @u/error
          (reset! u/error
