Handle .then call after reject/resolve
Add AMD define/window attachment