Add a custom callback + isRoot property

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