Added a task interface.

Most of the workers will need to do some setup and tear down before they
can start their tasks. I added an interface to facilitate this and
swaped out the lambda for this interface in `FanOut` and `Worker`.