Let's expand kernel and extensions API to provide start / stop events, and make sure they are aligned with each other.
- Add
Extension.uninstall(BaseKernel) - allows the kernel to shutdown extensions. This is especially useful in unit tests when multiple kernels can be created and stopped. It will allow the extensions to reset their statics.
- Add
BaseKernel.onStartup(..) (in addition to the existing onShutdown(..)). This would allow to separate loading extensions from kernel constructor
- Load and "install" extensions in
onStartup(..)
- Uninstall extensions in
onShutdown(..)