Add promises to tasks

Adds promises to tasks while maintaining compatibility with current implementation. Existing callbacks just get forwarded to the promise.