Do not serialize empty values for state and pipe

Change-Id: I641774560d2465c2a85d74d5d5b6f312861ff539
diff --git a/dev/js/src/state/manager.js b/dev/js/src/state/manager.js
index 136310b..d62827a 100644
--- a/dev/js/src/state/manager.js
+++ b/dev/js/src/state/manager.js
@@ -39,6 +39,10 @@
       this._states = JSON.parse('{' + value + '}');
     },
 
+    // Return element
+    element : function() {
+      return this._e;
+    },
 
     // Return the string representation of all states
     toString : function () {