Hook based programming in JavaScript. Node.JS and the Browser