MAINT: refactor converters and structure elements
This MR saves some possibly important changes from the original branch f-enhance-doc. The latter branch is now obsolete and will be removed.
Please check the changes carefully and refer to @salexan in case of doubt.