Add CommonJS support

Please update the npm package aftrer merging the PR. Now the package can be installed by the npm but don't work with the CommonJS as well.