 object containing name/value pairs for all the registered
     * custom components and native elements of the form. If there are elements
     * with duplicate names, then their values will get aggregated into an
     * array of values.
     *
     * @return {!Object}
     */
    serialize: function() {
      var json = {};

      function addSerializedElement(name, value) {
        // If the name doesn't exist, add it. Otherwise, serialize it to
        // an array,
        if (!json[name]) {
          js