Remove the clean up loop and instead clean up whenever it is needed. This ensures that the notification list is always up to date and fixes an issue where Gmail notifications might be missed due to outdated information about the current state (LP: #1451510). Also includes tests.