Added functions to artifact.js to handle lifecycle actions