Extract notification logic from new push servlet and add better test coverage for the new function.