Simplified check in `resolve` to determine if the input is a promise or thenable
Merged `master`