Fix CommonJS module.exports, edit tests