Add support for notification API, rewrite to use dependency injection (some code).