di-2: Add tests and refactor StashNotifier