Added documentation and changed how notifications are processed.