Make usable as node module or http server

Change-Id: I3b7cf6e5e8b815254138b8267b1676a197859805
Merge pull request #1 from dshkolnikov/master

Make usable as node module or http server