Move code of clear and create ouput tasks to create_targets.js module