write one record at a time instead of one massive string
raise any exceptions that happen during ptop preindexing
Merge pull request #4700 from dimagi/reindex

make ptop preindex not die