Converting an old JS file into a module