factor test guts into test.main.js, referenced from *.html test runners, add missing window test and gruntfile dependency
Merge branch 'squashed-test' of https://github.com/sjmiles/ShadowDOM into squashed-test