Fixed a bug where InvalidateCache would be calculating cache keys with updated values instead of the original.
BeforeSave and AfterSave now have access to the original documents.