Rete based rules engine written in javascript