added support for buffer output
small improvements for node.js