   [[nspace n "Start completion in this namespace." "user"]
    [prefix p "Prefix used for the match, ie. the part before /." ""]
    [base   b "Base pattern to be matched."]]
-  (let [nspace (resolve-and-load-namespace nspace)
+  (let [nspace (util/resolve-and-load-namespace nspace)
         prefix (symbol prefix)]
     (if-not (and (= base "") (= prefix ""))
-      (let [to-complete (decide-completion-in nspace prefix base)
-            completions (mapcat #(complete % nspace prefix base) to-complete)
-            completions (map #(apply make-completion-item %) completions)]
-        (println (clj->vim completions)))
+      (let [to-complete (util/decide-completion-in nspace prefix base)
+            completions (mapcat #(backend/complete % nspace prefix base)
+                                to-complete)
+            completions (map #(apply util/make-completion-item %) completions)]
+        (println (util/clj->vim completions)))
       (println "[]"))))

(defnail NamespaceInfo
  "Usage: ng de.kotka.vimclojure.nails.NamespaceInfo"
  []
  (println (clj->vim (map #(-> % symbol find-ns ns-info)
                          (line-seq (BufferedReader. *in*))))))

(defnail MacroExpand
  "Usage: ng de.kotka.vimclojure.nails.MacroExpand [options]"
  [[nspace n "Lookup the symbols in the given namespace." "user"]
   [one?   o "Expand only the first macro."]]
  (let [nspace (resolve-and-load-namespace nspace)
        expand (if one
                 #(macroexpand-1 %)
                 #(macroexpand %))]
    (binding [*ns* nspace]
      (doseq [expr (stream->seq *in*)]
        (-> expr expand pretty-print-code)))))

(defnail Repl
  "Usage: ng de.kotka.vimclojure.nails.Repl [options]"

(defnail JavadocPath
  "Usage: ng de.kotka.vimclojure.nails.JavadocPath [options]"
  [[nspace n "Lookup the symbols in the given namespace." "user"]]
  (let [nspace         (util/resolve-and-load-namespace nspace)
        our-ns-resolve #(ns-resolve nspace %)]
    (doseq [path (map #(-> %
                         symbol
                         our-ns-resolve
                         backend/javadoc-path-for-class)
                      (util/stream->seq *in*))]
      (println path))))

(defnail MetaLookup
  "Usage: ng de.kotka.vimclojure.nails.MetaLookup [options]"
  [[nspace n "Lookup the symbols in the given namespace." "user"]]
  (let [nspace         (util/resolve-and-load-namespace nspace)
        our-ns-resolve #(ns-resolve nspace %)]
    (doseq [metainfo (map #(-> % symbol our-ns-resolve meta)
                     (util/stream->seq *in*))]
      (util/pretty-print metainfo))))

(defnail DynamicHighlighting
  "Usage: ng de.kotka.vimclojure.nails.DynamicHighlighting"
  []
  (let [nspace    (read)
        c-c       (the-ns 'clojure.core)
        the-space (util/resolve-and-load-namespace nspace)
        refers    (remove #(= c-c (-> % second meta :ns)) (ns-refers the-space))
        aliases   (mapcat (fn [[the-alias the-alias-space]]
                            (map #(vector (symbol (name the-alias)
