Was gh supposed to be api? Maybe this would be simpler if the top level looked like:

var gh = (function() {
  ...
  return {
    onload: function () { /* set up DOM stuff */ }
  }
})();

window.onload = gh.onload;

Or even:

window.onload = (function () { /* the whole top level closure */; return function () { /* DOM setup */ } })();