Refactored notifications stuff into an angular service.