This was discussed a few days ago, here's the notes we took on the pad #16:

* JS modularity
** start simple: B2G style, but without mozilla JSisms (eg use var, not let or const)
*** https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/dragdrop.js

So that means for JS files with lots of things that we may not want to export, we would write:

var SomeObject = (function() {
  // implementation
  return {
    // exported interface
  };
}());