Add a custom callback

Fixes #3

Adds an option to override the default behavior of exiting the process and
printing a message.