[shadow-dom]: Refactor reprojection-{001,002}.

A similar refactoring to https://github.com/w3c/web-platform-tests/pull/211.