Promise support

This fixes #2, but significantly changes the entire API. This is grounds for a major version bump.