shadow-dom: Rework two tests that check createShadowRoot()'s behavior.

This branch has five new commits. The first three are simple clean-up of testcommon.js.

The fourth one adds the ability to testcommon.js so it can inject unprefixed methods and properties when only prefixed ones are available.

The fifth one is the meat of this branch. This change basically rewrites two existing tests, and moves them to a different location. Please consult the commit message of the change for details.