fix(ChangeDetector): fix issues with handling empty ranges
refactor(change_detection): make RecordRange responsible for removing iself