Allow users to provide a 'done' hook.

Closes gh-18.