Listen for close to exit process and for stats messages.

When a message contains stats we display whether tests have passed or failed.
On close of a socket, check for and exit process with correct exit code.
When tests have finished running, report stats and close socket.