Some rearranging and optimisation of server sent event rendering.
Expand server side event rendering example.