Added an isObject check.
Added an isThenable check and trying to add promise flag
Added a test for returning a promise in resolve callback.