build: output module instead of iife
This allows us to actually use top-level await if we want, and
modernises the output too I guess. Not sure if this is really necessary,
I mostly did it as part of silencing some ESLint errors that were
ultimately resolved differently anyway.