remove unused code, add new tests, restructure dirs

add tests for communication hierarchy, pause/resume, general cleanup of
test code, some TODOs
condense widget_api.js and publishEvents.js into a single file