Allow more finely-grained callbacks during the plugin registration lifecycle

- Added alternative callback format to allow backward compatibility
- Added example with usage
- Added tests