Add pipeline and sequence as high level promises API

Also add tests for promises.