Added commonjs type exports

Hi,

I added compatibility with commonjs type exports (for compatibility with tool like component(1)). 

Thx

(Sorry for confusion with old pull request #182. Github was pulling tricks with an unexisting branch. Closing it now)