Use each-async instead of counter for control flow
Add missing returns for error callbacks
Extract rewriteSourcemapPaths into its own function
Cleanup a forEach with map