Fix Dummy document class scoping issues

These shouldn't be hoisted to the top-level, they should be local to the tests.