fixed missing output data and some refactoring

Moved most of Cargomaster prototype into the pipeline. It’s ugly, but
at least it’s private.