node.js rete algorithm implementation