Modify .serialize() to more closely match jquery behaviour

For arrays containing scalars, query does not include the final array index