Implemented handling the case when an error happens in a 'resolve' callback
Supported the case when error happens in the body of the initial promise
Added more tests for chaining with 'then', small shallow re-factoring