diff --git a/public/js/spec/hintSpec.js b/public/js/spec/hintSpec.js
index 80807ff..a7232d4 100644
--- a/public/js/spec/hintSpec.js
+++ b/public/js/spec/hintSpec.js
@@ -705,4 +705,81 @@
     var hint = KorAP.Hint.create();
   });
 });
+
+
+describe('KorAP.ContextAnalyzer', function () {
+
+  it('should be initializable', function () {
+    var analyzer = KorAP.ContextAnalyzer.create(")");
+    expect(analyzer).toBe(undefined);
+
+    analyzer = KorAP.ContextAnalyzer.create(".+?");
+    expect(analyzer).not.toBe(undefined);
+
+  });
+
+  it('should check correctly', function () {
+    analyzer = KorAP.ContextAnalyzer.create(KorAP.context);
+    expect(analyzer.test("cnx/]cnx/c=")).toEqual("cnx/c=");
+    expect(analyzer.test("cnx/c=")).toEqual("cnx/c=");
+    expect(analyzer.test("cnx/c=np mate/m=mood:")).toEqual("mate/m=mood:");
+    expect(analyzer.test("impcnx/")).toEqual("impcnx/");
+    expect(analyzer.test("cnx/c=npcnx/")).toEqual("npcnx/");
+    expect(analyzer.test("mate/m=degree:pos corenlp/ne_dewac_175m_600="))
+      .toEqual("corenlp/ne_dewac_175m_600=");
+  });
+});
+
+describe('KorAP.InputField', function () {
+  var input;
+
+  beforeAll(function () {
+    input = document.createElement("input");
+    input.setAttribute("type", "text");
+    input.setAttribute("value", "abcdefghijklmno");
+    input.style.position = 'absolute';
+    input.style.top  = "20px";
+    input.style.left = "30px";
+    input.focus();
+    input.selectionStart = 5;
+  });
+
+  afterAll(function () {
+    document.getElementsByTagName("body")[0].removeChild(input);
+    document.getElementsByTagName("body")[0].removeChild(
+      document.getElementById("searchMirror")
+    );
+  });
+
+  it('should be initializable', function () {
+    // Supports: context, searchField
+    var inputField = KorAP.InputField.create(input);
+    expect(inputField._element).not.toBe(undefined);
+  });
+
+  it('should have text', function () {
+    var inputField = KorAP.InputField.create(input);
+
+    expect(inputField.value).toEqual("abcdefghijklmno");
+    expect(inputField.element.selectionStart).toEqual(5);
+    expect(inputField.split()[0]).toEqual("abcde");
+    expect(inputField.split()[1]).toEqual("fghijklmno");
+
+    inputField.insert("xyz");
+    expect(inputField.split()[0]).toEqual("abcdexyz");
+    expect(inputField.split()[1]).toEqual("fghijklmno");
+
+  });
+
+  it('should be correctly positioned', function () {
+    var inputField = KorAP.InputField.create(input);
+    document.getElementsByTagName("body")[0].appendChild(input);
+    inputField.reposition();
+    expect(inputField.mirror.style.left).toEqual("30px");
+    expect(inputField.mirror.style.top.match(/^(\d+)px$/)[1]).toBeGreaterThan(20);
+  });
+});
+
+
+
 */
diff --git a/public/js/spec/menuSpec.js b/public/js/spec/menuSpec.js
index 98f6e72..cc569a8 100644
--- a/public/js/spec/menuSpec.js
+++ b/public/js/spec/menuSpec.js
@@ -1,3 +1,4 @@
+// The OwnMenu item
 KorAP.OwnMenuItem = {
   create : function (params) {
     return Object.create(KorAP.MenuItem).upgradeTo(KorAP.OwnMenuItem)._init(params);
@@ -19,36 +20,8 @@
   }
 };
 
-KorAP.ComplexMenuItem = {
-  create : function (params) {
-    return Object.create(KorAP.MenuItem)
-      .upgradeTo(KorAP.ComplexMenuItem)
-      ._init(params);
-  },
-  content : function (content) {
-    if (arguments.length === 1) {
-      this._content = content;
-    };
-    return this._content;
-  },
-  _init : function (params) {
-    if (params[0] === undefined)
-      throw new Error("Missing parameters");
 
-    var r = document.createElement('div');
-    for (var i = 1; i <= params.length; i++) {
-      var h = document.createElement('h' + i);
-      h.appendChild(document.createTextNode(params[i-1]));
-      r.appendChild(h);
-    };
-
-    this._content = r;
-    this._lcField = ' ' + this.content().textContent.toLowerCase();
-
-    return this;
-  }
-};
-
+// The OwnMenu
 KorAP.OwnMenu = {
   create : function (params) {
     return Object.create(KorAP.Menu)
@@ -58,17 +31,7 @@
 };
 
 
-// Support for hint
-KorAP.HintMenu = {
-  create : function (context, params) {
-    var obj = Object.create(KorAP.Menu)
-      .upgradeTo(KorAP.HintMenu)
-      ._init(KorAP.HintMenuItem, params);
-    obj._context = context;
-    return obj;
-  }
-};
-
+// HintMenuItem
 KorAP.HintMenuItem = {
   create : function (params) {
    return Object.create(KorAP.MenuItem)
@@ -131,6 +94,50 @@
 };
 
 
+// HintMenu
+KorAP.HintMenu = {
+  create : function (context, params) {
+    var obj = Object.create(KorAP.Menu)
+      .upgradeTo(KorAP.HintMenu)
+      ._init(KorAP.HintMenuItem, params);
+    obj._context = context;
+    return obj;
+  }
+};
+
+
+// The ComplexMenuItem
+KorAP.ComplexMenuItem = {
+  create : function (params) {
+    return Object.create(KorAP.MenuItem)
+      .upgradeTo(KorAP.ComplexMenuItem)
+      ._init(params);
+  },
+  content : function (content) {
+    if (arguments.length === 1) {
+      this._content = content;
+    };
+    return this._content;
+  },
+  _init : function (params) {
+    if (params[0] === undefined)
+      throw new Error("Missing parameters");
+
+    var r = document.createElement('div');
+    for (var i = 1; i <= params.length; i++) {
+      var h = document.createElement('h' + i);
+      h.appendChild(document.createTextNode(params[i-1]));
+      r.appendChild(h);
+    };
+
+    this._content = r;
+    this._lcField = ' ' + this.content().textContent.toLowerCase();
+
+    return this;
+  }
+};
+
+
 
 describe('KorAP.MenuItem', function () {
   it('should be initializable', function () {
@@ -305,6 +312,14 @@
 
 
 describe('KorAP.Menu', function () {
+  var list = [
+    ["Constituency", "c=", "Example 1"],
+    ["Lemma", "l="],
+    ["Morphology", "m=", "Example 2"],
+    ["Part-of-Speech", "p="],
+    ["Syntax", "syn="]
+  ];
+
   it('should be initializable', function () {
     var list = [
       ["Constituency"],
@@ -342,13 +357,6 @@
   });
 
   it('should be visible', function () {
-    var list = [
-      ["Constituency", "c=", "Example 1"],
-      ["Lemma", "l="],
-      ["Morphology", "m=", "Example 2"],
-      ["Part-of-Speech", "p="],
-      ["Syntax", "syn="]
-    ];
     var menu = KorAP.HintMenu.create("cnx/", list);
     expect(menu.delete()).toBe(undefined);
     menu.limit(3);
@@ -368,14 +376,6 @@
   });
 
   it('should be filterable', function () {
-    var list = [
-      ["Constituency", "c=", "Example 1"],
-      ["Lemma", "l="],
-      ["Morphology", "m=", "Example 2"],
-      ["Part-of-Speech", "p="],
-      ["Syntax", "syn="]
-    ];
-
     var menu = KorAP.HintMenu.create("cnx/", list);
     menu.limit(3);
 
@@ -421,14 +421,6 @@
 
 
   it('should be nextable', function () {
-    var list = [
-      ["Constituency", "c=", "Example 1"],
-      ["Lemma", "l="],
-      ["Morphology", "m=", "Example 2"],
-      ["Part-of-Speech", "p="],
-      ["Syntax", "syn="]
-    ];
-
     var menu = KorAP.HintMenu.create("cnx/", list);
 
     // Show only 3 items
@@ -464,332 +456,249 @@
     expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate next (3)
+    // scroll!
     menu.next();
-//    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Lemma</strong>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Lemma</strong>");
+
     expect(menu.shownItem(0).active()).toBe(false);
-//    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
-//    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
     expect(menu.shownItem(2).active()).toBe(true);
     expect(menu.element().childNodes[3]).toBe(undefined);
-  });
-});
-
-
-/*
-describe('KorAP.Menu', function () {
-
-
 
     // Activate next (4)
     menu.next();
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
     expect(menu.shownItem(2).active()).toBe(true);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate next (5) - ROLL
     menu.next();
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Active next (6)
     menu.next();
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
     expect(menu.shownItem(1).active()).toBe(true);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
-
+    expect(menu.element().childNodes[3]).toBe(undefined);
   });
 
-
   it('should be prevable', function () {
-    var menu = KorAP.Menu.create("cnx/", list);
+    var menu = KorAP.HintMenu.create("cnx/", list);
 
-    KorAP.limit = 3;
+    menu.limit(3);
     expect(menu.show()).toBe(undefined);
 
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Lemma</strong>");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (1) - roll to bottom
     menu.prev();
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
     expect(menu.shownItem(2).active()).toBe(true);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (2)
     menu.prev();
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Morphology</strong><span>Example 2</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Part-of-Speech</strong>");
     expect(menu.shownItem(1).active()).toBe(true);
-    expect(menu.element.childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
+    expect(menu.element().childNodes[2].innerHTML).toEqual("<strong>Syntax</strong>");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (3)
     menu.prev();
-    expect(menu.shownItem(0).name).toEqual("Morphology");
+    expect(menu.shownItem(0).name()).toEqual("Morphology");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Part-of-Speech");
+    expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.shownItem(2).name).toEqual("Syntax");
+    expect(menu.shownItem(2).name()).toEqual("Syntax");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (4)
     menu.prev();
-    expect(menu.shownItem(0).name).toEqual("Lemma");
+    expect(menu.shownItem(0).name()).toEqual("Lemma");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.shownItem(2).name).toEqual("Part-of-Speech");
+    expect(menu.shownItem(2).name()).toEqual("Part-of-Speech");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (5)
     menu.prev();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Lemma");
+    expect(menu.shownItem(1).name()).toEqual("Lemma");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.shownItem(2).name).toEqual("Morphology");
+    expect(menu.shownItem(2).name()).toEqual("Morphology");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate next (1)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Lemma");
+    expect(menu.shownItem(1).name()).toEqual("Lemma");
     expect(menu.shownItem(1).active()).toBe(true);
-    expect(menu.shownItem(2).name).toEqual("Morphology");
+    expect(menu.shownItem(2).name()).toEqual("Morphology");
     expect(menu.shownItem(2).active()).toBe(false);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
 
     // Activate prev (6)
     menu.prev();
 
     // Activate prev (7)
     menu.prev();
-    expect(menu.shownItem(0).name).toEqual("Morphology");
+    expect(menu.shownItem(0).name()).toEqual("Morphology");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Part-of-Speech");
+    expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
     expect(menu.shownItem(1).active()).toBe(false);
-    expect(menu.shownItem(2).name).toEqual("Syntax");
+    expect(menu.shownItem(2).name()).toEqual("Syntax");
     expect(menu.shownItem(2).active()).toBe(true);
-    expect(menu.element.childNodes[3]).toBe(undefined);
+    expect(menu.element().childNodes[3]).toBe(undefined);
   });
 
-  it('should be navigatable and filterable (prefix = "o")', function () {
-    var menu = KorAP.Menu.create("cnx/", list);
 
-    KorAP.limit = 2;
+  it('should be navigatable and filterable (prefix = "o")', function () {
+    var menu = KorAP.HintMenu.create("cnx/", list);
+    menu.limit(2);
 
     expect(menu.show("o")).toBe(undefined);
 
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>C<em>o</em>nstituency</strong><span>Example 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>M<em>o</em>rphology</strong><span>Example 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (1)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>C<em>o</em>nstituency</strong><span>Example 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>M<em>o</em>rphology</strong><span>Example 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
     expect(menu.shownItem(1).active()).toBe(true);
     expect(menu.shownItem(2)).toBe(undefined);
 
-
     // Next (2)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Morphology");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>M<em>o</em>rphology</strong><span>Example 2</span>");
+    expect(menu.shownItem(0).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Part-of-Speech");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Part-<em>o</em>f-Speech</strong>");
+    expect(menu.shownItem(1).name()).toEqual("Part-of-Speech");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Part-<mark>o</mark>f-Speech</strong>");
     expect(menu.shownItem(1).active()).toBe(true);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (3)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>C<em>o</em>nstituency</strong><span>Example 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>C<mark>o</mark>nstituency</strong><span>Example 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>M<em>o</em>rphology</strong><span>Example 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>M<mark>o</mark>rph<mark>o</mark>l<mark>o</mark>gy</strong><span>Example 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
   });
 
+
   it('should be navigatable and filterable (prefix = "ex", "e")', function () {
-    var menu = KorAP.Menu.create("cnx/", list);
+    var menu = KorAP.HintMenu.create("cnx/", list);
 
-    KorAP.limit = 2;
-
+    menu.limit(2);
     expect(menu.show("ex")).toBe(undefined);
 
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><em>Ex</em>ample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>Ex</em>ample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (1)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><em>Ex</em>ample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>Ex</em>ample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
     expect(menu.shownItem(1).active()).toBe(true);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (2)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><em>Ex</em>ample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constituency</strong><span><mark>Ex</mark>ample 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>Ex</em>ample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>Ex</mark>ample 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Reset limit
-    KorAP.limit = 5;
+    menu.limit(5);
 
     // Change show
     expect(menu.show("e")).toBe(undefined);
 
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constitu<em>e</em>ncy</strong><span><em>E</em>xample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>E</em>xample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (1)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constitu<em>e</em>ncy</strong><span><em>E</em>xample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
     expect(menu.shownItem(0).active()).toBe(false);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>E</em>xample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
     expect(menu.shownItem(1).active()).toBe(true);
     expect(menu.shownItem(2)).toBe(undefined);
 
     // Next (2)
     menu.next();
-    expect(menu.shownItem(0).name).toEqual("Constituency");
-    expect(menu.element.childNodes[0].innerHTML).toEqual("<strong>Constitu<em>e</em>ncy</strong><span><em>E</em>xample 1</span>");
+    expect(menu.shownItem(0).name()).toEqual("Constituency");
+    expect(menu.element().childNodes[0].innerHTML).toEqual("<strong>Constitu<mark>e</mark>ncy</strong><span><mark>E</mark>xampl<mark>e</mark> 1</span>");
     expect(menu.shownItem(0).active()).toBe(true);
-    expect(menu.shownItem(1).name).toEqual("Morphology");
-    expect(menu.element.childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><em>E</em>xample 2</span>");
+    expect(menu.shownItem(1).name()).toEqual("Morphology");
+    expect(menu.element().childNodes[1].innerHTML).toEqual("<strong>Morphology</strong><span><mark>E</mark>xampl<mark>e</mark> 2</span>");
     expect(menu.shownItem(1).active()).toBe(false);
     expect(menu.shownItem(2)).toBe(undefined);
   });
 });
-
-describe('KorAP.ContextAnalyzer', function () {
-
-  it('should be initializable', function () {
-    var analyzer = KorAP.ContextAnalyzer.create(")");
-    expect(analyzer).toBe(undefined);
-
-    analyzer = KorAP.ContextAnalyzer.create(".+?");
-    expect(analyzer).not.toBe(undefined);
-
-  });
-
-  it('should check correctly', function () {
-    analyzer = KorAP.ContextAnalyzer.create(KorAP.context);
-    expect(analyzer.test("cnx/]cnx/c=")).toEqual("cnx/c=");
-    expect(analyzer.test("cnx/c=")).toEqual("cnx/c=");
-    expect(analyzer.test("cnx/c=np mate/m=mood:")).toEqual("mate/m=mood:");
-    expect(analyzer.test("impcnx/")).toEqual("impcnx/");
-    expect(analyzer.test("cnx/c=npcnx/")).toEqual("npcnx/");
-    expect(analyzer.test("mate/m=degree:pos corenlp/ne_dewac_175m_600="))
-      .toEqual("corenlp/ne_dewac_175m_600=");
-  });
-});
-
-describe('KorAP.InputField', function () {
-  var input;
-
-  beforeAll(function () {
-    input = document.createElement("input");
-    input.setAttribute("type", "text");
-    input.setAttribute("value", "abcdefghijklmno");
-    input.style.position = 'absolute';
-    input.style.top  = "20px";
-    input.style.left = "30px";
-    input.focus();
-    input.selectionStart = 5;
-  });
-
-  afterAll(function () {
-    document.getElementsByTagName("body")[0].removeChild(input);
-    document.getElementsByTagName("body")[0].removeChild(
-      document.getElementById("searchMirror")
-    );
-  });
-
-  it('should be initializable', function () {
-    // Supports: context, searchField
-    var inputField = KorAP.InputField.create(input);
-    expect(inputField._element).not.toBe(undefined);
-  });
-
-  it('should have text', function () {
-    var inputField = KorAP.InputField.create(input);
-
-    expect(inputField.value).toEqual("abcdefghijklmno");
-    expect(inputField.element.selectionStart).toEqual(5);
-    expect(inputField.split()[0]).toEqual("abcde");
-    expect(inputField.split()[1]).toEqual("fghijklmno");
-
-    inputField.insert("xyz");
-    expect(inputField.split()[0]).toEqual("abcdexyz");
-    expect(inputField.split()[1]).toEqual("fghijklmno");
-
-  });
-
-  it('should be correctly positioned', function () {
-    var inputField = KorAP.InputField.create(input);
-    document.getElementsByTagName("body")[0].appendChild(input);
-    inputField.reposition();
-    expect(inputField.mirror.style.left).toEqual("30px");
-    expect(inputField.mirror.style.top.match(/^(\d+)px$/)[1]).toBeGreaterThan(20);
-  });
-});
-*/
diff --git a/public/js/spec/vcSpec.js b/public/js/spec/vcSpec.js
index 49e9275..1a24fb6 100644
--- a/public/js/spec/vcSpec.js
+++ b/public/js/spec/vcSpec.js
@@ -35,37 +35,37 @@
 };
 
 var demoFactory = buildFactory(KorAP.VirtualCollection, {
-  "@type":"korap:docGroup",
+  "@type":"koral:docGroup",
   "operation":"operation:or",
   "operands":[
     {
-      "@type":"korap:docGroup",
+      "@type":"koral:docGroup",
       "operation":"operation:and",
       "operands":[
         {
-          "@type":"korap:doc",
+          "@type":"koral:doc",
           "key":"Titel",
           "value":"Baum",
           "match":"match:eq"
         },
         {
-          "@type":"korap:doc",
+          "@type":"koral:doc",
           "key":"Veröffentlichungsort",
           "value":"hihi",
           "match":"match:eq"
         },
         {
-          "@type":"korap:docGroup",
+          "@type":"koral:docGroup",
           "operation":"operation:or",
           "operands":[
             {
-              "@type":"korap:doc",
+              "@type":"koral:doc",
               "key":"Titel",
               "value":"Baum",
               "match":"match:eq"
             },
             {
-              "@type":"korap:doc",
+              "@type":"koral:doc",
               "key":"Veröffentlichungsort",
               "value":"hihi",
               "match":"match:eq"
@@ -75,7 +75,7 @@
       ]
     },
     {
-      "@type":"korap:doc",
+      "@type":"koral:doc",
       "key":"Untertitel",
       "value":"huhu",
       "match":"match:eq"
@@ -90,7 +90,7 @@
   var stringFactory = buildFactory(KorAP.Doc, {
     "key"   : "author",
     "value" : "Max Birkendale",
-    "@type" : "korap:doc"
+    "@type" : "koral:doc"
   });
 
   // Create example factories
@@ -99,7 +99,7 @@
     "type"  : "type:date",
     "match" : "match:eq",
     "value" : "2014-11-05",
-    "@type" : "korap:doc"
+    "@type" : "koral:doc"
   });
 
   // Create example factories
@@ -107,7 +107,7 @@
     "key"   : "title",
     "type"  : "type:regex",
     "value" : "[^b]ee.+?",
-    "@type" : "korap:doc"
+    "@type" : "koral:doc"
   });
 
   it('should be initializable', function () {
@@ -251,7 +251,7 @@
     // Serialize string
     doc = stringFactory.create();
     expect(doc.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "type" : "type:string",
       "key" : "author",
       "value" : "Max Birkendale",
@@ -261,7 +261,7 @@
     // Serialize regex
     doc = regexFactory.create();
     expect(doc.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "type" : "type:regex",
       "value" : "[^b]ee.+?",
       "match" : "match:eq",
@@ -272,7 +272,7 @@
       match: "match:ne"
     });
     expect(doc.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "type" : "type:regex",
       "value" : "[^b]ee.+?",
       "match" : "match:ne",
@@ -281,7 +281,7 @@
 
     doc = dateFactory.create();
     expect(doc.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "type" : "type:date",
       "value" : "2014-11-05",
       "match" : "match:eq",
@@ -292,7 +292,7 @@
       value : "2014"
     });
     expect(doc.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "type" : "type:date",
       "value" : "2014",
       "match" : "match:eq",
@@ -339,7 +339,7 @@
   var docFactory = buildFactory(
     KorAP.Doc,
     {
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "match":"match:eq",
       "key" : "author",
       "value" : "Max Birkendale"
@@ -348,7 +348,7 @@
 
   var docGroupFactory = buildFactory(
     KorAP.DocGroup, {
-      "@type" : "korap:docGroup",
+      "@type" : "koral:docGroup",
       "operation" : "operation:and",
       "operands" : [
 	docFactory.create().toJson(),
@@ -455,18 +455,18 @@
     var docGroup = docGroupFactory.create();
 
     expect(docGroup.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:docGroup",
+      "@type" : "koral:docGroup",
       "operation" : "operation:and",
       "operands" : [
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key" : 'author',
 	  "match": 'match:eq',
 	  "value": 'Max Birkendale',
 	  "type": 'type:string'
 	},
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key": 'pubDate',
 	  "match": 'match:eq',
 	  "value": '2014-12-05',
@@ -481,36 +481,36 @@
     expect(docGroup.toQuery()).toEqual('author = "Max Birkendale" & pubDate in 2014-12-05');
 
     docGroup = docGroupFactory.create({
-      "@type" : "korap:docGroup",
+      "@type" : "koral:docGroup",
       "operation" : "operation:or",
       "operands" : [
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key" : 'author',
 	  "match": 'match:eq',
 	  "value": 'Max Birkendale',
 	  "type": 'type:string'
 	},
 	{
-	  "@type" : "korap:docGroup",
+	  "@type" : "koral:docGroup",
 	  "operation" : "operation:and",
 	  "operands" : [
 	    {
-	      "@type": 'korap:doc',
+	      "@type": 'koral:doc',
 	      "key": 'pubDate',
 	      "match": 'match:geq',
 	      "value": '2014-05-12',
 	      "type": 'type:date'
 	    },
 	    {
-	      "@type": 'korap:doc',
+	      "@type": 'koral:doc',
 	      "key": 'pubDate',
 	      "match": 'match:leq',
 	      "value": '2014-12-05',
 	      "type": 'type:date'
 	    },
 	    {
-	      "@type": 'korap:doc',
+	      "@type": 'koral:doc',
 	      "key": 'foo',
 	      "match": 'match:ne',
 	      "value": '[a]?bar',
@@ -545,7 +545,7 @@
     expect(docGroup.operation()).toEqual('or');
 
     docGroup.append({
-      "@type": 'korap:doc',
+      "@type": 'koral:doc',
       "key": 'pubDate',
       "match": 'match:eq',
       "value": '2014-12-05',
@@ -577,7 +577,7 @@
     expect(docGroup.operation()).toEqual('or');
 
     docGroup.append({
-      "@type": 'korap:doc',
+      "@type": 'koral:doc',
       "key": 'pubDate',
       "match": 'match:eq',
       "value": '2014-12-05',
@@ -643,7 +643,7 @@
 describe('KorAP.Doc element', function () {
   it('should be initializable', function () {
     var docElement = KorAP.Doc.create(undefined, {
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "key":"Titel",
       "value":"Baum",
       "match":"match:eq"
@@ -660,7 +660,7 @@
     expect(docE.children[2].getAttribute('data-type')).toEqual('string');
 
     expect(docElement.toJson()).toEqual(jasmine.objectContaining({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "key":"Titel",
       "value":"Baum",
       "match":"match:eq"
@@ -672,18 +672,18 @@
   it('should be initializable', function () {
 
     var docGroup = KorAP.DocGroup.create(undefined, {
-      "@type" : "korap:docGroup",
+      "@type" : "koral:docGroup",
       "operation" : "operation:and",
       "operands" : [
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key" : 'author',
 	  "match": 'match:eq',
 	  "value": 'Max Birkendale',
 	  "type": 'type:string'
 	},
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key": 'pubDate',
 	  "match": 'match:eq',
 	  "value": '2014-12-05',
@@ -721,29 +721,29 @@
 
   it('should be deserializable with nested groups', function () {
     var docGroup = KorAP.DocGroup.create(undefined, {
-      "@type" : "korap:docGroup",
+      "@type" : "koral:docGroup",
       "operation" : "operation:or",
       "operands" : [
 	{
-	  "@type": 'korap:doc',
+	  "@type": 'koral:doc',
 	  "key" : 'author',
 	  "match": 'match:eq',
 	  "value": 'Max Birkendale',
 	  "type": 'type:string'
 	},
 	{
-	  "@type" : "korap:docGroup",
+	  "@type" : "koral:docGroup",
 	  "operation" : "operation:and",
 	  "operands" : [
 	    {
-	      "@type": 'korap:doc',
+	      "@type": 'koral:doc',
 	      "key": 'pubDate',
 	      "match": 'match:geq',
 	      "value": '2014-05-12',
 	      "type": 'type:date'
 	    },
 	    {
-	      "@type": 'korap:doc',
+	      "@type": 'koral:doc',
 	      "key": 'pubDate',
 	      "match": 'match:leq',
 	      "value": '2014-12-05',
@@ -787,18 +787,18 @@
 describe('KorAP.VirtualCollection', function () {
 
   var simpleGroupFactory = buildFactory(KorAP.DocGroup, {
-    "@type" : "korap:docGroup",
+    "@type" : "koral:docGroup",
     "operation" : "operation:and",
     "operands" : [
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key" : 'author',
 	"match": 'match:eq',
 	"value": 'Max Birkendale',
 	"type": 'type:string'
       },
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:eq',
 	"value": '2014-12-05',
@@ -808,29 +808,29 @@
   });
 
   var nestedGroupFactory = buildFactory(KorAP.VirtualCollection, {
-    "@type" : "korap:docGroup",
+    "@type" : "koral:docGroup",
     "operation" : "operation:or",
     "operands" : [
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key" : 'author',
 	"match": 'match:eq',
 	"value": 'Max Birkendale',
 	"type": 'type:string'
       },
       {
-	"@type" : "korap:docGroup",
+	"@type" : "koral:docGroup",
 	"operation" : "operation:and",
 	"operands" : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:geq',
 	    "value": '2014-05-12',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:leq',
 	    "value": '2014-12-05',
@@ -842,25 +842,25 @@
   });
 
   var flatGroupFactory = buildFactory(KorAP.VirtualCollection, {
-    "@type" : "korap:docGroup",
+    "@type" : "koral:docGroup",
     "operation" : "operation:and",
     "operands" : [
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:geq',
 	"value": '2014-05-12',
 	"type": 'type:date'
       },
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:leq',
 	"value": '2014-12-05',
 	"type": 'type:date'
       },
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'foo',
 	"match": 'match:eq',
 	"value": 'bar',
@@ -880,7 +880,7 @@
 
   it('should be based on a doc', function () {
     var vc = KorAP.VirtualCollection.render({
-      "@type" : "korap:doc",
+      "@type" : "koral:doc",
       "key":"Titel",
       "value":"Baum",
       "match":"match:eq"
@@ -1115,37 +1115,37 @@
 
   it('should flatten on import', function () {
     var vc = KorAP.VirtualCollection.create().render({
-      "@type":"korap:docGroup",
+      "@type":"koral:docGroup",
       "operation":"operation:or",
       "operands":[
 	{
-	  "@type":"korap:docGroup",
+	  "@type":"koral:docGroup",
 	  "operation":"operation:or",
 	  "operands":[
             {
-              "@type":"korap:doc",
+              "@type":"koral:doc",
               "key":"Titel",
               "value":"Baum",
               "match":"match:eq"
             },
             {
-              "@type":"korap:doc",
+              "@type":"koral:doc",
               "key":"Veröffentlichungsort",
               "value":"hihi",
               "match":"match:eq"
             },
             {
-              "@type":"korap:docGroup",
+              "@type":"koral:docGroup",
               "operation":"operation:or",
               "operands":[
 		{
-		  "@type":"korap:doc",
+		  "@type":"koral:doc",
 		  "key":"Titel",
 		  "value":"Baum",
 		  "match":"match:eq"
 		},
 		{
-		  "@type":"korap:doc",
+		  "@type":"koral:doc",
 		  "key":"Veröffentlichungsort",
 		  "value":"hihi",
 		  "match":"match:eq"
@@ -1155,7 +1155,7 @@
 	  ]
 	},
 	{
-	  "@type":"korap:doc",
+	  "@type":"koral:doc",
 	  "key":"Untertitel",
 	  "value":"huhu",
 	  "match":"match:eq"
@@ -1211,27 +1211,27 @@
 
 describe('KorAP._delete (event)', function () {
   var complexVCFactory = buildFactory(KorAP.VirtualCollection,{
-    "@type": 'korap:docGroup',
+    "@type": 'koral:docGroup',
     'operation' : 'operation:and',
     'operands' : [
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:eq',
 	"value": '2014-12-05',
 	"type": 'type:date'
       },
       {
-	"@type" : 'korap:docGroup',
+	"@type" : 'koral:docGroup',
 	'operation' : 'operation:or',
 	'operands' : [
 	  {
-	    '@type' : 'korap:doc',
+	    '@type' : 'koral:doc',
 	    'key' : 'title',
 	    'value' : 'Hello World!'
 	  },
 	  {
-	    '@type' : 'korap:doc',
+	    '@type' : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1242,7 +1242,7 @@
 
   it('should clean on root docs', function () {
     var vc = KorAP.VirtualCollection.render({
-      "@type": 'korap:doc',
+      "@type": 'koral:doc',
       "key": 'pubDate',
       "match": 'match:eq',
       "value": '2014-12-05',
@@ -1261,18 +1261,18 @@
   it ('should remove on nested docs', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:and',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1291,18 +1291,18 @@
   it ('should clean on doc groups', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:and',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1364,43 +1364,43 @@
   it ('should remove on nested doc groups (list flattening)', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:or',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  },
 	  {
-	    "@type": 'korap:docGroup',
+	    "@type": 'koral:docGroup',
 	    'operation' : 'operation:and',
 	    'operands' : [
 	      {
-		"@type": 'korap:doc',
+		"@type": 'koral:doc',
 		"key": 'pubDate',
 		"match": 'match:eq',
 		"value": '2014-12-05',
 		"type": 'type:date'
 	      },
 	      {
-		"@type" : 'korap:docGroup',
+		"@type" : 'koral:docGroup',
 		'operation' : 'operation:or',
 		'operands' : [
 		  {
-		    '@type' : 'korap:doc',
+		    '@type' : 'koral:doc',
 		    'key' : 'title',
 		    'value' : 'Hello World!'
 		  },
 		  {
-		    '@type' : 'korap:doc',
+		    '@type' : 'koral:doc',
 		    'key' : 'yeah',
 		    'value' : 'juhu'
 		  }
@@ -1443,27 +1443,27 @@
 
 describe('KorAP._add (event)', function () {
   var complexVCFactory = buildFactory(KorAP.VirtualCollection,{
-    "@type": 'korap:docGroup',
+    "@type": 'koral:docGroup',
     'operation' : 'operation:and',
     'operands' : [
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:eq',
 	"value": '2014-12-05',
 	"type": 'type:date'
       },
       {
-	"@type" : 'korap:docGroup',
+	"@type" : 'koral:docGroup',
 	'operation' : 'operation:or',
 	'operands' : [
 	  {
-	    '@type' : 'korap:doc',
+	    '@type' : 'koral:doc',
 	    'key' : 'title',
 	    'value' : 'Hello World!'
 	  },
 	  {
-	    '@type' : 'korap:doc',
+	    '@type' : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1475,18 +1475,18 @@
   it ('should add new unspecified doc with "and"', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:and',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1520,18 +1520,18 @@
   it ('should add new unspecified doc with "or"', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:and',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1710,18 +1710,18 @@
   it ('should wrap on root', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:and',
 	'operands' : [
 	  {
-	    "@type": 'korap:doc',
+	    "@type": 'koral:doc',
 	    "key": 'pubDate',
 	    "match": 'match:eq',
 	    "value": '2014-12-05',
 	    "type": 'type:date'
 	  },
 	  {
-	    "@type" : 'korap:doc',
+	    "@type" : 'koral:doc',
 	    'key' : 'foo',
 	    'value' : 'bar'
 	  }
@@ -1744,7 +1744,7 @@
   it ('should add on root (case "and")', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:eq',
 	"value": '2014-12-05',
@@ -1766,7 +1766,7 @@
   it ('should add on root (case "or")', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:doc',
+	"@type": 'koral:doc',
 	"key": 'pubDate',
 	"match": 'match:eq',
 	"value": '2014-12-05',
@@ -1787,36 +1787,36 @@
   it ('should support multiple sub groups per group', function () {
     var vc = KorAP.VirtualCollection.render(
       {
-	"@type": 'korap:docGroup',
+	"@type": 'koral:docGroup',
 	'operation' : 'operation:or',
 	'operands' : [
 	  {
-	    "@type": 'korap:docGroup',
+	    "@type": 'koral:docGroup',
 	    'operation' : 'operation:and',
 	    'operands' : [
 	      {
-		"@type": 'korap:doc',
+		"@type": 'koral:doc',
 		"key": 'title',
 		"value": 't1',
 	      },
 	      {
-		"@type" : 'korap:doc',
+		"@type" : 'koral:doc',
 		'key' : 'title',
 		'value' : 't2'
 	      }
 	    ]
 	  },
 	  {
-	    "@type": 'korap:docGroup',
+	    "@type": 'koral:docGroup',
 	    'operation' : 'operation:and',
 	    'operands' : [
 	      {
-		"@type": 'korap:doc',
+		"@type": 'koral:doc',
 		"key": 'title',
 		"value": 't3',
 	      },
 	      {
-		"@type" : 'korap:doc',
+		"@type" : 'koral:doc',
 		'key' : 'title',
 		'value' : 't4'
 	      }
@@ -1844,7 +1844,7 @@
 
   it('should be initializable', function () {
     var rewrite = KorAP.Rewrite.create({
-      "@type" : "korap:rewrite",
+      "@type" : "koral:rewrite",
       "operation" : "operation:modification",
       "src" : "querySerializer",
       "scope" : "tree"
@@ -1855,7 +1855,7 @@
   it('should be deserialized by docs', function () {
     var doc = KorAP.Doc.create(undefined,
       {
-        "@type":"korap:doc",
+        "@type":"koral:doc",
         "key":"Titel",
         "value":"Baum",
         "match":"match:eq"
@@ -1866,13 +1866,13 @@
 
     doc = KorAP.Doc.create(undefined,
       {
-        "@type":"korap:doc",
+        "@type":"koral:doc",
         "key":"Titel",
         "value":"Baum",
         "match":"match:eq",
 	"rewrites" : [
 	  {
-	    "@type" : "korap:rewrite",
+	    "@type" : "koral:rewrite",
 	    "operation" : "operation:modification",
 	    "src" : "querySerializer",
 	    "scope" : "tree"
@@ -1888,3 +1888,11 @@
   });
 */
 });
+/*
+describe('KorAP.DocKey', function () {
+  it('should be initializable', function () {
+    var docKey = KorAP.DocKey.create();
+    expect(docKey.toString()).toEqual('...');
+  });
+});
+*/
