Strip index.js down to its bare essentials, move primary logic to main.js, and expose the latter via module.exports. This allows tests to execute the same code path(s) HMR runs in production.