Rewrite NotificationFunctionsImpl in the new style

Still too coupled with UserSession, but shouldn't break.