Improve MathSearchUpload to allow for large result sets

* Improves the performance of validation.
* Allows to split large results sets to multiple files.

Change-Id: I78a59d50da0e144f25058346b1e65bccc00ecfa1