Separated out test code.
Implemented callbacks for results.