Added method to set the callback.

This is important functionality that resolves circular dependency issues
that come up when the main root node of the React Tree is in a file that
requires the file where cortex is initialized.