Cleanup and fixes.

Track visibility of tree elements (visible = in the tree output), to
make ISROOT work in all corner cases. Let new parent elements use root
as parent, so root contains all orphans. Mark statis whats not used
outside of hier.c.