Refactoring

Done some refactoring of the plugin. 
The goal was to remove the huge class PipelineFactory and move the functionality into the domain objects (previously in the model package).
This will make the design more domain driven and hopefully more readable and testable.