Resolve the Ref dependencies using a (over)complicated web of promises.