Worker globals removal: ports

This PR removed the `ports` global from the worker and attaches it to the `TkWorker` instance as a property. This is part of a larger refactoring of the worker aiming at allowing constructing a whole worker environment injecting dependencies through constructor options.