added node.js support
made some small patches to support node.js