Add callback and tests
Merge pull request #5 from tmcw/master

Add callback and tests