Merge sections with identical title

- Add test
- In order of appearence (it would be better to use the contents of the "main" file first)

Fixes #300.