Convert JavaScript codebases using global namespaces to AMD modules