Changed the Promise implementation

Corrected bugs and extended the Promise implementation.
Bugs: 1) Calling resolve() or reject() directly in constructor, would
make it behave unespectedly.
Extended support: onuncatched event fire on reject without catch.