Supporting promises

Fixes #1

I had to rename some of the method to make this happen. Hope that is
okay ;-)
toString -> text
toBuffer -> buffer