Fixes prefix in json for queries.
Merge pull request #177 from Shopify/predupsort_fail_noprefix

Pre-dupsort: fix query when prefix is passed in JSON
Fix period based stream flushing. Adds flush-period and flush-threshold URL param support to the streaming endpoints.