Refactoring into utils.js, with a hacky delayer.js.