UpsertAsync now calculates batch size dynamically

Fixed tests to reflect the new edge case of any single element having more
than 800 parameters.

Fixed braces.