Change to CommonJS

Makes this useful for node.js testing