Cleanup hint specification to leave no document fragments behind

Change-Id: I036ea5ef80f09556ae99d51eda76129ea97c7326
diff --git a/dev/js/src/hint.js b/dev/js/src/hint.js
index e1b0796..c93d178 100644
--- a/dev/js/src/hint.js
+++ b/dev/js/src/hint.js
@@ -29,22 +29,6 @@
   "use strict";
 
   /**
-   * @define {regex} Regular expression for context
-   */
-  KorAP.context = KorAP.context ||
-    "(?:^|[^-_a-zA-Z0-9])" +   // Anchor
-    "((?:[-_a-zA-Z0-9]+?)\/" + // Foundry
-    "(?:" +
-    "(?:[-_a-zA-Z0-9]+?)=" +   // Layer
-    "(?:"+
-    "(?:[^:=\/ ]+?):|" +       // Key
-    "(?:[^-=\/ ]+?)-" +        // Node
-    ")?" +
-    ")?" +
-    ")$";
-  // KorAP.annotationHelper = KorAP.annotationHelper || { "-" : [] };
-
-  /**
    * Return keycode based on event
    */
 
@@ -83,6 +67,21 @@
         console.log("No annotationhelper defined");
         return;
       };
+      
+      /**
+       * @define {regex} Regular expression for context
+       */
+      KorAP.context = KorAP.context ||
+        "(?:^|[^-_a-zA-Z0-9])" +   // Anchor
+        "((?:[-_a-zA-Z0-9]+?)\/" + // Foundry
+        "(?:" +
+        "(?:[-_a-zA-Z0-9]+?)=" +   // Layer
+        "(?:"+
+        "(?:[^:=\/ ]+?):|" +       // Key
+        "(?:[^-=\/ ]+?)-" +        // Node
+        ")?" +
+        ")?" +
+        ")$";
 
       // Get input field
       var qfield = param["inputField"] || document.getElementById("q-field");