This change cleans up the way wasm exports and globals
are generated, particualrly for -r/--relocatable where
globals need to be created and exported in order for
output relocations which reference them.
Remove the need for a per file GlobalIndexOffset and
instead set the output index for each symbol directly.
This simplifies the code in several places.
Can we now get rid of the ugly WrittenToSymtab variable? It's state that doesn't properly belong on the Sym at all - much better to have a local vector like you've done.