Rewrite some crusty old code to use async (createExperiment.js)