very simple implementation of Promise.defer

borrowed test suite from cujojs/when