AMD-ize JavaScript source code