FoldingPanel: cleanup + add comments/docstrings