Simple promises library in Swift