    [clojure.set :as set]
    [dag_unify.core :refer [copy fail? get-in strip-refs unify]]))
 
-(btest/init-db)
-
-;; TODO: move this from babel.test.it to babel.lexicon or similar.
-(defn initialize []
-  (log/info (str "recompiling and writing lexicon to database.."))
-  (write-lexicon "it" (lexicon/compile-lexicon))
-  (log/info (str "done.")))
+(defonce model
+  (do
+    (btest/init-db)
+    @@(get models :it)))
 
 ;; TODO: consider removing special-purpose grammars like grammar/np-grammar
 ;; and just use model instead.

               (for [[k lexemes] lexicon]
                 (let [filtered-lexemes
                       (filter (fn [lexeme]
                                 (or (and (contains? chosen-subset k)
                                          (= (get-in lexeme [:synsem :cat])
                                             :verb)
                                          (not (empty? (get-in lexeme [:synsem :subcat] [])))
                                          (map? (get-in lexeme [:synsem :subcat :2]))
                                          (empty? (get-in lexeme [:synsem :subcat :3] [])))
                                     (and (= (get-in lexeme [:synsem :cat])
                                             :noun)
                                          (= (get-in lexeme [:synsem :pronoun])

(def np-grammar (delay (grammar/np-grammar)))

(defn generate-speed-test [spec & [times]]
  (btest/generate-speed-test spec models times))

(defn run-passato-prossimo-test []
  (generate-speed-test {:synsem {:cat :verb :subcat []
