Centralize and track imports/exports.

So that we can "unresolve" them.
Unexport var symbols when destroying modules.

The problem with a global list is that an unloaded module with unresolved
imports will get garbage written in.  This should be safer, and hopefully
not slower.

Next up: func imports.
Optimize a bit by checking module names.
Unresolve function imports, track in loader.
Get rid of the bad object errors on shutdown.
Merge pull request #3542 from unknownbrackets/module-imports

Track module imports and exports with a proper lifecycle