another implement promise, inspired by http://promises-aplus.github.io/promises-spec/