code: function(titleMap, originalEnum) {
      if (!angular.isArray(titleMap)) {
        var canonical = [];
        if (originalEnum) {
          angular.forEach(originalEnum, function(value, index) {
            canonical.push({name: titleMap[value], value: value});
          });
        } else {
          angular.forEach(titleMap, function(name, value) {
            canonical.push({name: name, value: value});
          });
        }
        return canonical;
      }
      return titleMap;
    }
docs: Takes a titleMap in either object or list format and returns one in in the list format.