rework for node 0.8+
Merge pull request #27 from shtylman/master

rework module for node >= 0.8