Improved Promise typedef (follow lib intentions)

Interface Promise<T> was missing the static methods: as, error, is and
when
- Changed interface Promise<T> to class promise<T>
- Added static methods of 'as', 'error', 'is' and 'when'
- Removed instance methods 'as', 'error', 'is' and 'when'
- Changed resolvedCallback of 'then' to use ...value: T[] instead of
value: T (lib intention)
- Changed interface IPromise<T> to use ...value: T[] instead of value: T
(lib intention)