Made the output directory inside 'delivery' when we have the XML file, eg. for piper runs. Moved some more generic stuff into the common module.