Implementation of Promises/A+