Ported to node, closes #1