Write exports into subdirectories

This needs to be most likely stubbed in the unit test to prevent unnecessary output.