Lightweight javascript implementation of promises.