Both packages moved to ESM-only in v3, so this migrates the project
from CommonJS to ESM: adds "type": "module" to package.json, switches
tsconfig to module/moduleResolution "nodenext", adds .js extensions to
all relative imports, and reconfigures Jest for ESM support.