Prepares JS to handle test results and compilation failures.
Merge pull request #690 from typesafehub/wip/add-event-listeners

Prepares JS to handle test results and compilation failures.