Add tests for CommonJS module

Improves #138