Collapse into promises-sane form. Add cleanup.