Minimal implementation of Promises/A+