New notifications system

This part isn't quite done. I'm merging now to avoid too many conflicts in the future.