Modernize ES for-loops and remove problematic for-in loops

This slightly modifies the behaviour of errors (see init.js)

Change-Id: I1aab691d5b7e8167b6213378bdd9139c133202cd
diff --git a/dev/js/src/match/treehierarchy.js b/dev/js/src/match/treehierarchy.js
index e9c6122..0a7bf49 100644
--- a/dev/js/src/match/treehierarchy.js
+++ b/dev/js/src/match/treehierarchy.js
@@ -109,8 +109,7 @@
 
     // Parse the snippet
     _parse : function (parent, children, mark) {
-      for (var i in children) {
-       var c = children[i];
+      children.forEach(function(c) {
 
        // Element node
        if (c.nodeType == 1) {
@@ -164,7 +163,7 @@
 
            this._addEdge(parent, id);
          };
-      };
+      }, this);
       return this;
     },