Deal with output data and some misc fixes.

Specifically:
- Put the output files into the cud.
- Catchup with output transfer state.
- Fix intermediate output also for last stage.
- Use the basename of files for the substitutions.
- Remove the / to underscore replacement that was in place temporarily.
Update example for output data staging.

Specifically:
- input_prefix is now data_prefix.
- Use the prefix also for output data names.
- Change output names to match Bishop paper.