Javascript event scheduler for node.js and browser