Convert a JavaScript project using global namespaces into a series of AMD modules