Currently to handle imports in the code, a user can use a replacement like {{imports}} at the top of the output to add to. But this results in imports that are written in the order that they appear in the questionnaire rather than the desired sorted input list, and if different branches need to use the same imports, it could lead to duplicated imports.
It would be useful to have a dedicated handling of imports so that they appear sorted and deduplicated.