Make npm installed version work

Not sure exactly what the intended design was/is, but these changes allow the npm installed version to work. 

Thanks for an awesome project. I had a half-built version of something in the same direction, rather contribute to decking instead.