Refine module syntax in source scripts.

Self-execute the exporting with the module closure
passed in.