Add refcounting code to free up deleted nodes

Created by  voroskoi  on January 11, 2025
L5PE2JYUWXH6KHU7COHEMCHPK7LXFIFTXXCT7GB26S3U5RT5WPKAC
Change contents