Qunit module preparation rewrite

Needs preliminary review. Missing at least some documentation and changelog entry.
Does this seem like it can help in integration in some way? If so, it should be documented.