Create collapsible tree structure from HTML unordered lists