Convert JavaScript using modules defined in the global namespace into AMD modules