Use requirejs for clientside scripting
diff --git a/dev/demo/all.js b/dev/demo/all.js
index 5ce1266..29dd405 100644
--- a/dev/demo/all.js
+++ b/dev/demo/all.js
@@ -271,8 +271,7 @@
   ]
 };
 
-
-KorAP.hintArray = {
+var hintArray = {
   "-" : [
     ["Connexor",   "cnx/",     "Constituency, Lemma, Morphology, Part-of-Speech, Syntax"],
     ["CoreNLP",    "corenlp/", "Named Entities"],
@@ -417,44 +416,48 @@
   ]
 };
 
-// Parse and show the table
-// Override getMatchInfo API call
-KorAP.API.getMatchInfo = function(match, callObj, cb) {
-  if (callObj["spans"] !== undefined && callObj["spans"] === true) {
-    cb({ "snippet": treeSnippet2 });
+
+requirejs.config({
+  baseUrl: '../js/src',
+  paths : {
+    'lib': '../lib'
   }
-  else {
-    cb({ "snippet": snippet });
-  }
-};
+});
 
+require(['init'], function (init) {
 
-/**
- * Do some things at the beginning.
- */
-document.addEventListener('DOMContentLoaded', function () {
+  KorAP.hintArray = hintArray;
 
-  // Decorate actions
-  var init = KorAP.init();
+  // Parse and show the table
+  // Override getMatchInfo API call
+  KorAP.API.getMatchInfo = function(match, callObj, cb) {
+    if (callObj["spans"] !== undefined && callObj["spans"] === true) {
+      cb({ "snippet": treeSnippet2 });
+    }
+    else {
+      cb({ "snippet": snippet });
+    }
+  };
+
+  /**
+   * Do some things at the beginning.
+   */
 
   // document.getElementById('vc-choose').click();
-
   // init.tutorial.show();
 
-/*
+  /*
+    KorAP.HintMenu.hide = function () {};
+    init.hint.show();
 
-  KorAP.HintMenu.hide = function () {};
-  init.hint.show();
-
-
-  var menu = KorAP.MatchTreeMenu.create(
-    undefined,
-    menuContent
-  );
-  menu.hide = function () {};
-  document.getElementById('menu').appendChild(menu.element());
-  menu.limit(3);
-  menu.show();
-  menu.focus();
-*/
+    var menu = KorAP.MatchTreeMenu.create(
+      undefined,
+      menuContent
+    );
+    menu.hide = function () {};
+    document.getElementById('menu').appendChild(menu.element());
+    menu.limit(3);
+    menu.show();
+    menu.focus();
+  */
 });