Starting rewrite from (mostly) scratch with promises.