refactor to address issues 27 and 33

This refactor should fix provide a means of dealing with both issues 27 and 33

https://github.com/puppetlabs/puppetlabs-nodejs/issues/27
https://github.com/puppetlabs/puppetlabs-nodejs/issues/33

spec tests work for me here.
Please let me know if there's anything I can do to expedite getting this merged, and a new forge module pushed