add gruntfile for build task, build, and test runner using build

factor test guts into test.main.js, referenced from *.html test runners