Callback3

I've merged dkirkham's callback2 branch with your master. This functionality is very helpful. Would you mind accepting it upstream? Thanks.