Closures in Pipelineenv

(this also merged the devel branch)