Add Promise implementation based on es6 spec.

Fixes #170.