Description
Right now the library maintains a Map<number, Element> on both sides of the bridge, additionally Elements are given a property index that corresponds to their number in the mapping. This allows both sides to easily reference Elements as they are created or modified.
However this creates a hard reference to the Element and means that these objects cannot be fully removed by GC.
If we move away from a mapping, and instead leverage the Elements position in the tree as its identifier, we are no longer holding a direct reference. This could mean GC is able to more easily remove these Element objects when they are no longer necessary.
However, this likely introduces other problems to solve like race conditions between the placement of nodes during events. We'll be exploring this option since it's the easiest to test.