Fix note modified and edited fields

Only set modified when really modified (not when fetching/replacing).
Only set edited when the user edits the note.