A JavaScript promises alternative