Synched with upstream ops.js: added MIT headers