upgrade pyxform
Merge pull request #1314 from SEL-Columbia/upgrade_pyxform

upgrade pyxform
added some js logging of data
quick fix for fetching count on every next/prev click - still performs request on first record view, client-side after that
fixed typo
removed refs to curPage
Merge pull request #1320 from SEL-Columbia/1317_count

1317 count
Used Q objects in an 'OR' query for the Export.exports_outdated() class method, cleaned up the logic, and added annotations
Instead of querying the Export table *twice* in export_tools.should_create_new_export(), use the new definition of Export.exports_outdated(), even though that too is really ugly: Export.exports_outdated() should *not* be a classmethod of Export, but sticking to incremental changes for now.
Merge pull request #1322 from SEL-Columbia/improve_export

Improve export
Reduced the number of database calls in the initial part of create_instance() without changing the logic (such as it is)
While preserving same legacy logic, reduced the number of queries, especially on Instance
Made saving attachments into a separate thread, so that create_instance() can return w/o waiting for all media to be saved
Like other optimizations, attempt to fetch the single, expected duplicate in one shot, rather that filter and index 0
Not real update: want to see travis on master again (July 10)
More tweaks to make the legacy creation logic work within the context of a more efficient set of queries (Formhub is not easy)
Restore async flag for ParsedInstance save, since it it needed by mongodb; also explicitly turned autocommit (the default) on, in case it was turned off somewhere else...
Reluctantly switched back to saving attachment files serially, before instance returns (potentially still slow, but less likely to create integreity errors)
Refuse to give up on saving the media attachments in a separate thread, since it would be a huge time improvement in server response.
This approach tries passing the Instance pk to the thread, and have the object look it up before starting (should work in theory).
Just to check about a suspicion about why the tests fail:
the test User is being deleted immeidately after this returns,
while the thread saving attachments may still be working.
IRL, this condition would not occur, but just to confirm,
introducing an artificial pause for letting the attachment
saving thread to finish.