Add closed handler, per type configuration

This PR makes a few changes:

1) added a closed handler that callers can use to take action when a notification is closed.
2) allows additional per notification type options configuration
3) reorganizes the code slightly so the main file can use strict