Alter Element._cache_artifact so it uses the virtual directory system
Background
At the moment, Element._cache_artifact
exports files from the Sandbox's virtual directory to a real file system, creates some other directories around it, and adds in logs and other metadata YAML files, and then creates an Artifact from that directory.
We should be able to do all this using the virtual directory system, possibly writing the metadata and logs to a real directory then importing that into the new virtual directory, thus avoiding having to extract the majority of the artifact and recreate it.
Task description
- Modify _cache_artifact to use the virtual directory system.
Acceptance Criteria
Equivalent functionality verified by a remote execution test.