JSDuck: Cover more of external.js and implement @source

Taken from VisualEditor repo (authored by myself under MIT).
Hereby released under GPL as well.

Change-Id: I4dc1a0e5c618e0a20ae6f308b4ecf266d041e22c
Merge "JSDuck: Cover more of external.js and implement @source"