It's needed because DocumentManager only knows about Documents that have been addRef()'ed (because JS lacks weak references, ref counting is the only way to track Documents globally without leaking).  So when a rename occurs, only documents we know about will get updated.  That wasn't true before this pull request, which is precisely why it had a memory leak.