Qunit module preparation rewrite

Needs preliminary review. Missing at least some documentation and changelog entry.
So, instead of this function, we use something like the following.