function define(moduleName, deps, payload) {
  if (typeof moduleName != "string") {
    throw new TypeError('Expected string, got: ' + moduleName);
  }

  if (arguments.length == 2) {
    payload = deps;
  }

  if (moduleName in define.modules) {
    throw new Error("Module already defined: " + moduleName);
  }
  define.modules[moduleName] = payload;
}
Define a module along with a payload.
@param {string} moduleName Name for the payload
@param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
@param {function} payload Function with (require, exports, module) params