Adding dundermain.
Added collapse_sections function, which combines sections with the same key and mode.