Updating stdin/stderr/stdout tests.

Also fixing some event emitter bugs.