Improvements to managing pipeline stages.

Tweaks to get ALLPATHs running correctly.

Optimised imports.