gensym each test re-export module individually

Fixes #16597

I'm not 100% sure this is the correct way to handle this - but I wasn't able to find a better way without doing way more refactoring of the code that I was comfortable with.  Comments and criticism are appreciated :smile:
If this just uses a dummy span, it should call `bug` instead of `span_bug`. It also looks like some of this module is conditionally executed, so could this bug possibly be triggered on something like an empty file?