Add compare function to CommonJS exports

It was there for global, but missing for cjs exports.