Fix performance regressions in tree.js (fixes #2396)
Fix performance regressions in tree.js (fixes #2396)

1ec5/iD,mapmeld/iD,bagage/iD,digidem/iD,energiekollektiv/openmod.sh-id,kartta-labs/iD,andreic-telenav/iD,mapmeld/iD,mapmeld/iD,morray/iD,AndreasHae/iD,andreic-telenav/iD,bagage/iD,openstreetmap/iD,zbycz/iD,kartta-labs/iD,ngageoint/hootenanny-ui,bagage/iD,edpop/iD,edpop/iD,energiekollektiv/openmod.sh-id,kepta/iD,edpop/iD,openstreetmap/iD,kepta/iD,1ec5/iD,1ec5/iD,kartta-labs/iD,tbicr/iD,ngageoint/hootenanny-ui,zbycz/iD,digidem/iD,openstreetmap/iD,AndreasHae/iD,morray/iD,ngageoint/hootenanny-ui,tbicr/iD,AndreasHae/iD