Refactor, document, improve section type detection

Especially for quiz types