[js/python] don't generate require/import for types that are not directly referenced by non-extern code

Subj. See #3050. This is done by marking directly referenced types with a special `@:reallyUsed` metadata in DCE and then generating `@:jsRequire`/`@:pythonImport` code only for those who have that metadata.