A simple implementation of a promise in js. NOTE: This is *not* using JS's new promise feature which isn't supported by all browsers.