Replaced callbacks with deferred objects.
Merge branch 'master' into deferred