Demo for query storing

Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/safe-json-parse/.npmignore b/node_modules/safe-json-parse/.npmignore
new file mode 100644
index 0000000..fd31f5e
--- /dev/null
+++ b/node_modules/safe-json-parse/.npmignore
@@ -0,0 +1,15 @@
+.DS_Store
+.monitor
+.*.swp
+.nodemonignore
+releases
+*.log
+*.err
+fleet.json
+public/browserify
+bin/*.json
+.bin
+build
+compile
+.lock-wscript
+node_modules
diff --git a/node_modules/safe-json-parse/.testem.json b/node_modules/safe-json-parse/.testem.json
new file mode 100644
index 0000000..41ab90e
--- /dev/null
+++ b/node_modules/safe-json-parse/.testem.json
@@ -0,0 +1,14 @@
+{
+    "launchers": {
+        "node": {
+            "command": "node ./test"
+        }
+    },
+    "src_files": [
+        "./**/*.js"
+    ],
+    "before_tests": "npm run build-test",
+    "on_exit": "rm test/static/bundle.js",
+    "test_page": "test/static/index.html",
+    "launch_in_dev": ["node", "phantomjs"]
+}
diff --git a/node_modules/safe-json-parse/.travis.yml b/node_modules/safe-json-parse/.travis.yml
new file mode 100644
index 0000000..52424f8
--- /dev/null
+++ b/node_modules/safe-json-parse/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+  - 0.8
+  - 0.9
+  - 0.10
+script: node ./test/index.js
diff --git a/node_modules/safe-json-parse/LICENCE b/node_modules/safe-json-parse/LICENCE
new file mode 100644
index 0000000..5b1b5dc
--- /dev/null
+++ b/node_modules/safe-json-parse/LICENCE
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/safe-json-parse/README.md b/node_modules/safe-json-parse/README.md
new file mode 100644
index 0000000..5b2adf7
--- /dev/null
+++ b/node_modules/safe-json-parse/README.md
@@ -0,0 +1,39 @@
+# safe-json-parse
+
+[![build status][1]][2] [![dependency status][3]][4]
+
+<!-- [![browser support][5]][6] -->
+
+Parse JSON safely without throwing
+
+## Example
+
+```js
+var safeParse = require("safe-json-parse")
+
+safeParse("{}", function (err, json) {
+    /* we have json */
+})
+
+safeparse("WRONG", function (err) {
+    /* we have err! */
+})
+```
+
+## Installation
+
+`npm install safe-json-parse`
+
+## Contributors
+
+ - Raynos
+
+## MIT Licenced
+
+
+  [1]: https://secure.travis-ci.org/Raynos/safe-json-parse.png
+  [2]: https://travis-ci.org/Raynos/safe-json-parse
+  [3]: https://david-dm.org/Raynos/safe-json-parse.png
+  [4]: https://david-dm.org/Raynos/safe-json-parse
+  [5]: https://ci.testling.com/Raynos/safe-json-parse.png
+  [6]: https://ci.testling.com/Raynos/safe-json-parse
diff --git a/node_modules/safe-json-parse/examples/simple.js b/node_modules/safe-json-parse/examples/simple.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/safe-json-parse/examples/simple.js
diff --git a/node_modules/safe-json-parse/index.js b/node_modules/safe-json-parse/index.js
new file mode 100644
index 0000000..ff25646
--- /dev/null
+++ b/node_modules/safe-json-parse/index.js
@@ -0,0 +1,18 @@
+module.exports = SafeParse
+
+function SafeParse(obj, reviver, callback) {
+    if (arguments.length === 2) {
+        callback = reviver
+        reviver = null
+    }
+
+    var json
+
+    try {
+        json = JSON.parse(obj, reviver)
+    } catch (err) {
+        return callback(err)
+    }
+
+    callback(null, json)
+}
diff --git a/node_modules/safe-json-parse/package.json b/node_modules/safe-json-parse/package.json
new file mode 100644
index 0000000..5d6a74d
--- /dev/null
+++ b/node_modules/safe-json-parse/package.json
@@ -0,0 +1,79 @@
+{
+  "_from": "safe-json-parse@~1.0.1",
+  "_id": "safe-json-parse@1.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=",
+  "_location": "/safe-json-parse",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "safe-json-parse@~1.0.1",
+    "name": "safe-json-parse",
+    "escapedName": "safe-json-parse",
+    "rawSpec": "~1.0.1",
+    "saveSpec": null,
+    "fetchSpec": "~1.0.1"
+  },
+  "_requiredBy": [
+    "/body"
+  ],
+  "_resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz",
+  "_shasum": "3e76723e38dfdda13c9b1d29a1e07ffee4b30b57",
+  "_spec": "safe-json-parse@~1.0.1",
+  "_where": "C:\\Users\\marcr\\Desktop\\KorAp\\Git\\Kalamar\\node_modules\\body",
+  "author": {
+    "name": "Raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/Raynos/safe-json-parse/issues",
+    "email": "raynos2@gmail.com"
+  },
+  "bundleDependencies": false,
+  "contributors": [
+    {
+      "name": "Raynos"
+    }
+  ],
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Parse JSON safely without throwing",
+  "devDependencies": {
+    "tape": "~1.0.2"
+  },
+  "homepage": "https://github.com/Raynos/safe-json-parse",
+  "keywords": [],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://github.com/Raynos/safe-json-parse/raw/master/LICENSE"
+    }
+  ],
+  "main": "index",
+  "name": "safe-json-parse",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/Raynos/safe-json-parse.git"
+  },
+  "scripts": {
+    "test": "node ./test/index.js"
+  },
+  "testling": {
+    "files": "test/index.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/16..latest",
+      "firefox/nightly",
+      "chrome/22..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.0.1"
+}
diff --git a/node_modules/safe-json-parse/test/index.js b/node_modules/safe-json-parse/test/index.js
new file mode 100644
index 0000000..ffea3a5
--- /dev/null
+++ b/node_modules/safe-json-parse/test/index.js
@@ -0,0 +1,26 @@
+var test = require("tape")
+
+var safeParse = require("../index")
+
+test("safeParse is a function", function (assert) {
+    assert.equal(typeof safeParse, "function")
+    assert.end()
+})
+
+test("safeParse valid json", function (assert) {
+    safeParse("{ \"foo\": true }", function (err, json) {
+        assert.ifError(err)
+        assert.equal(json.foo, true)
+
+        assert.end()
+    })
+})
+
+test("safeParse faulty", function (assert) {
+    safeParse("WRONG", function (err) {
+        assert.ok(err)
+        assert.equal(err.message, "Unexpected token W")
+
+        assert.end()
+    })
+})
diff --git a/node_modules/safe-json-parse/test/static/index.html b/node_modules/safe-json-parse/test/static/index.html
new file mode 100644
index 0000000..60f6ef8
--- /dev/null
+++ b/node_modules/safe-json-parse/test/static/index.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+<head>
+    <title>TAPE Example</title>
+    <script src="/testem.js"></script>
+    <script src="test-adapter.js"></script>
+    <script src="bundle.js"></script>
+</head>
+<body>
+</body>
+</html>
diff --git a/node_modules/safe-json-parse/test/static/test-adapter.js b/node_modules/safe-json-parse/test/static/test-adapter.js
new file mode 100644
index 0000000..c512792
--- /dev/null
+++ b/node_modules/safe-json-parse/test/static/test-adapter.js
@@ -0,0 +1,49 @@
+(function () {
+    var Testem = window.Testem
+    var regex = /^((?:not )?ok) (\d+) (.+)$/
+
+    Testem.useCustomAdapter(tapAdapter)
+
+    function tapAdapter(socket){
+        var results = {
+            failed: 0
+            , passed: 0
+            , total: 0
+            , tests: []
+        }
+
+        socket.emit('tests-start')
+
+        Testem.handleConsoleMessage = function(msg){
+            var m = msg.match(regex)
+            if (m) {
+                var passed = m[1] === 'ok'
+                var test = {
+                    passed: passed ? 1 : 0,
+                    failed: passed ? 0 : 1,
+                    total: 1,
+                    id: m[2],
+                    name: m[3],
+                    items: []
+                }
+
+                if (passed) {
+                    results.passed++
+                } else {
+                    results.failed++
+                }
+
+                results.total++
+
+                socket.emit('test-result', test)
+                results.tests.push(test)
+            } else if (msg === '# ok' || msg.match(/^# tests \d+/)){
+                socket.emit('all-test-results', results)
+            }
+
+            // return false if you want to prevent the console message from
+            // going to the console
+            // return false
+        }
+    }
+}())