Add type priorities
Generate teiHeader
Fix ordering