Changing typeof check to look to module instead of exports to prevent accidental undefined error.
Merge pull request #1 from markgardner/master

Changing typeof check to look to module instead of exports to prevent accidental undefined error