Fixed database and getNextNotification logic.  Removed type and notificationDate from NotificationRule since they were not necessary.