Notifications refactor and History improvements

Now ready to merge!