improved commit 66ef1643b2139778e579b8b3ef342a5bc5b08571 that avoids writing source maps for externs

1) moved the logic earlier, where it checks if source maps have been requested
2) applied the same fix to other compc classes that also need it
3 files changed