Fixed test suite and vc query integration
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 9354917..c960ec2 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -46,7 +46,7 @@
      * Replace Virtual Collection field
      */
     var vcname;
-    var input = document.getElementById('vc');
+    var input = document.getElementById('collection');
     if (input) {
       input.style.display = 'none';
       vcname = document.createElement('span');
@@ -122,18 +122,8 @@
 
 	// The vc is not visible
 	else {
-	  // The vc is not rendered yet
-	  if (vc === undefined) {
-	    vc = vcClass.create([
-	      ['title', 'string'],
-	      ['subTitle', 'string'],
-	      ['pubDate', 'date'],
-	      ['author', 'string']
-	    ]);
-
-	    if (KorAP.currentVC !== undefined)
-	      vc.fromJson(KorAP.currentVC);
-	  };
+	  if (vc === undefined)
+	    vc = _getCurrentVC(vcClass);
 	  view.appendChild(vc.element());
 	  this.classList.add('active');
 	};
@@ -175,6 +165,20 @@
 */
 
     /**
+     * Add VC creation on submission.
+     */
+    var form = document.getElementById('searchform');
+    if (form !== undefined) {
+      form.addEventListener('submit', function (e) {
+	if (vc === undefined)
+	  vc = _getCurrentVC(vcClass);
+
+	if (vc !== undefined)
+	  input.value = vc.toQuery();
+      });
+    };
+
+    /**
      * Init hint helper
      * has to be final because of
      * reposition
@@ -186,3 +190,18 @@
     return obj;
   });
 });
+
+// Render Virtual collection
+function _getCurrentVC (vcClass) {
+  var vc = vcClass.create([
+    ['title', 'string'],
+    ['subTitle', 'string'],
+    ['pubDate', 'date'],
+    ['author', 'string']
+  ]);
+  if (KorAP.currentVC !== undefined)
+    vc.fromJson(KorAP.currentVC);
+
+  return vc;
+};
+
diff --git a/dev/js/src/util.js b/dev/js/src/util.js
index 7c2f474..f17ec2a 100644
--- a/dev/js/src/util.js
+++ b/dev/js/src/util.js
@@ -1,3 +1,5 @@
+window.KorAP = window.KorAP || {};
+
 // Don't let events bubble up
 if (Event.halt === undefined) {
   // Don't let events bubble up
@@ -35,7 +37,9 @@
 
 
 define(function () {
+  // Todo: That's double now!
   KorAP.API = KorAP.API || {};
+  KorAP.Locale = KorAP.Locale || {};
 
   var loc = KorAP.Locale;
   loc.OR  = loc.OR  || 'or';