Improved notification code + tests
Allow delayed notifications