Qunit module preparation rewrite

Needs preliminary review. Missing at least some documentation and changelog entry.
I still don't quite understand why this change caused that, but I don't see anything wrong with it. Looks more interesting :P