Fix bug with terminating workers
Make web worker seamlessly integrate code with clean external worker and deploy worker thread