Fix conflict of test variable with events module

A `events` array was being declared which smothered the `events` module in that
function scope.  Renamed to `EVENTS` to coincide with other test asset variables
and free the `events` module for later use.

Signed-off-by: Tim Smart <tim@fostle.com>
Add test for checking correct write order

Ensures `writeHeaders` is called before `write`, especially in the case where
data events are emitted immediately.

Signed-off-by: Tim Smart <tim@fostle.com>