More work on deferreds and promises