Put a "handlers" object in the worker to handle all messages, initialised to just contain "add_handlers", and added another stage to the bootstrap to populate this object. Modified the rest of the code to work through this handlers object.