Fixed addExternal when no file name is provided.
Fixed the case where addExternal is missing the file name and the path doesn't include it as well.
Appended .js to the default file name in addExternal.
Added comments to the code changes.
Merge branch 't/10913'