Detect webworker as third runtime

Adding detection and support for web workers with special handling of console outputs that are not allowed inside of workers.