Process mosaicfile path and supply output path for macro code.
Cleanup imports.
Remove todo.
Write macro code before tile configs.

This way the macro will be available even if something fails during the
generation of the tile configs.
Add refactor note.
Prototype of Python port for FilamentsExporter.