Make layer_selector node IDs deterministic.

Using a static int to generate uniqueIDs for nodes is problematic
when nodes load in a different order. To make node IDs deterministic
we derive them from the text value and their position in the tree.