Possibly the simplest implementation of JavaScript Promises