promise implementation: pass tests added in d1da557bbdf3201af647e63ef6eb810b643d7aeb

- supports Promises/A+ requirement, that If onRejected returns a value x,
returned promise must be resolved using x
- supports Promises/A+ requirement, that If onResolved returns a value x,
returned promise must be resolved using x