add CommonJS support
correct bad main entry
Merge pull request #45 from aaronmccall/master

add CommonJS support