Processor cleanup

This is a cleanup of the processor code, and some code to delay the creation of a temporary working directory in order to avoid creating empty ones. This also includes all the changes for velruse integration pull request, because it depends on some of those changes, I'm making two pull requests so they can be viewed, applied and/or discussed independently.