Don't assume stdin and stdout for Listen. This simplifies testing.
Check for nil payloads.
Flush after writing result. Trim whitespace before Atoi.
Complete event tests.