Allow the archive option to be a function

This branch allows the archive option to be a function, this is useful if you want to set the name of the archive dynamically or use a global value set in another task.