[BUGFIX] Fix of .zip exports of extension

Before this, all files of an extension where included into its
.zip export. Now $TYPO3_CONF_VARS['EXT']['excludeForPackaging']
is respected.

Also the function responsible for the export is cleaned up and uses
more core API than before.

Change-Id: I1c06084e4da3ee18014563572fd270ea1e4d3ec5
Fixes: #45404
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/18344
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert