Fix period based stream flushing. Adds flush-period and flush-threshold URL param support to the streaming endpoints.

Conflicts:
	server/server_event_handlers.go
	server/server_event_handlers_test.go
Fixes event query handler, events_written reference.
Fixes stream flush and adds better stream flush logging.
Merge pull request #180 from Shopify/dupsort_stream_flush

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