Use typed array by index when joining.

Finding junctions is the most memory-intensive part of the topology computation
because it requires recording the neighbors of every point. To reduce memory
overhead, we now store the left neighbor and right neighbor as indexes in
separate hashtables rather than creating a new tuple for each point. This also
lets us use typed arrays to store the values.
Use a hashset to record junctions.

This is more efficient than a hashmap when we only care about set membership.