handle either strings returned or dojo/Promises (cherry-pick 142f5d1)