added functions to kill worker threads and their accompanying web worker instances