Lightweight implementation of Promises/A+