Cleanup code and standardize callbacks.
fix tests for new callback format.
Merge pull request #5 from hybridgroup/standardize-callback

Cleanup code and standardize callbacks.