Different lookup depending on directive type.
Decouple sections and clauses export because they're separate now.
Merge pull request #1155 from reciprocity/feature/empty-section-export-patch

Clause export fix rebased to be patch