Promises/A+ implementation for Swift