minimal Promises/A+ implementation