Introduce a WorkerFactoryBase.

This is the first step in allowing people to define non file based
worker factories.
Update all examples and tests to use WorkerFactoryBase when required.
Merge pull request #175 from robertmaynard/worker_factory_base

Introduce a WorkerFactoryBase.