refactor how tests are run

test factory now has generic function to run a test (and fire promise
notifications, etc), which simplifies the individual tests
add support to cancel running test