Introduce widget class

Change-Id: I949cd46c48b9176c0b013c1c65f1fba949413c8e
diff --git a/dev/js/src/util.js b/dev/js/src/util.js
index 5b6c8f8..80f6364 100644
--- a/dev/js/src/util.js
+++ b/dev/js/src/util.js
@@ -59,6 +59,24 @@
   return e.keyCode;
 };
 
+function _dec2hex (dec) {
+  return ('0' + dec.toString(16)).substr(-2)
+};
+
+
+/**
+ * Create random identifiers
+ */
+/*
+ * code based on
+ * https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript#8084248
+ */
+function randomID (len) {
+  var arr = new Uint8Array((len || 40) / 2)
+  window.crypto.getRandomValues(arr)
+  return Array.from(arr, _dec2hex).join('')
+};
+
 
 define(function () {
   // Todo: That's double now!