Notifications working / More refactoring

Cleaned up some more of the code and got the notifications for
numrequests, and friends working live. Will need to change a bit more
about it. Also numgroups is implemented and ready for that to be
possible when the g_members table is used.