Make `then` Promises chainable

Make it possible to chain Promises and transform the value, as described in the spec. The second `then` should receive the value returned by the first `then`.

It's not quite compliant with the full spec, because it is still mutating the same Promise instead of returning a new one. But it's a step in the right direction.