Adds an optional callback function to alerts when being closed

Needed to fix #114 and #128