Pre-dupsort: fix streaming endpoint flushing and add support for flush-period and flush-threshold URL parameters

This PR fixes an issue with period based flushing, where the timer was only being created once, and expands the tests to cover these cases. This PR also adds the flush-period and flush-threshold URL parameter support, so that this can be configured per streaming request.

@benbjohnson @mkobetic @charlescng