Let gwf-local inject dependencies into the TaskScheduler.

This includes the environment, which is now obtained through the
get_environment() function. It automatically decides which environment
to return.

This commit also introduces the Event type which is used by Tasks to
emit events when a file transfer is started, succeeds or fails. Thus,
Workflow is now completely free of reporting and environment code.