CLC-1175 - only store notifications for known users

JIRA: https://jira.media.berkeley.edu/jira/browse/CLC-1175

Also includes a bit of DRYing up the code.