text: 
  /**
   * Helpers functions such as formatters or extensions
   * to libraries.
   */
  define('helpers', ['jquery', 'underscore'],
    function($, _) {
  
    var helpers = {};
  
    /**
     * Override Backbone's ajax call to use JSONP by default as well
     * as force a specific callback to ensure that server side
     * caching is effective.
     */
    helpers.overrideBackboneAJAX = function() {
      Backbone.ajax = function() {
        var options = arguments;
  
        if (options[0].dataTypeForce !== true) {
          options[0].dataType = 'jsonp';
          options[0].jsonpCallback = 'mpServerSideCachingHelper' +
            _.hash(options[0].url);
        }
        return Backbone.$.ajax.apply(Backbone.$, options);
      };
    };
  
    /**
     * Returns version of MSIE.
     */
    helpers.isMSIE = function() {
      var match = /(msie) ([\w.]+)/i.exec(navigator.userAgent);
      return match ? parseInt(match[2], 10) : false;
    };
  
    /**
     * Wrapper for a JSONP request, the first set of options are for
     * the AJAX request, while the other are from the application.
     */
    helpers.jsonpRequest = function(requestOptions, appOptions) {
      var options = requestOptions || {};
      options.dataType = 'jsonp';
  
      /*
      options.jsonpCallback = 'mpServerSideCachingHelper' +
        _.hash(options.url);
  
      if (appOptions.remoteProxy) {
        options.url = options.url + '&callback=mpServerSideCachingHelper';
        options.url = appOptions.remoteProxy + encodeURIComponent(options.url);
        options.cache = true;
      }
      */
  
      return $.ajax.apply($, [options]);
    };
  
    /**
     * Data source handling.  For development, we can call
     * the data directly from the JSON file, but for production
     * we want to proxy for JSONP.
     *
     * `name` should be relative path to dataset
     * `options` are app options
     *
     * Returns jQuery's defferred object.
     */
    helpers.getLocalData = function(name, options) {
      var useJSONP = false;
      var defers = [];
      name = (_.isArray(name)) ? name : [ name ];
  
      // If the data path is not relative, then use JSONP
      if (options && options.paths && options.paths.data.indexOf('http') === 0) {
        useJSONP = true;
      }
  
      // Go through each file and add to defers
      _.each(name, function(d) {
        var defer;
  
        if (useJSONP) {
          defer = helpers.jsonpRequest({
            url: options.remoteProxy + encodeURI(options.paths.data + d)
          }, options);
        }
        else {
          defer = $.getJSON(options.paths.data + d);
        }
        defers.push(defer);
      });
  
      return $.when.apply($, defers);
    };
  
    /**
     * Reads query string and turns into object.
     */
    helpers.parseQueryString = function() {
      var assoc  = {};
      var decode = function(s) {
        return decodeURIComponent(s.replace(/\+/g, " "));
      };
      var queryString = location.search.substring(1);
      var keyValues = queryString.split('&');
  
      _.each(keyValues, function(v, vi) {
        var key = v.split('=');
        if (key.length > 1) {
          assoc[decode(key[0])] = decode(key[1]);
        }
      });
  
      return assoc;
    };
  
    return helpers;
  });
  