Use chrome.notifications API, remove repeating code