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.