Send a real EventSource event for heartbeat

The EventSource connection can get stuck (in TCP half-open state*) and there's no way
for the client to detect that. This commit changes the way heartbeat is sent, instead of
sending a newline character, it sends an empty event of type heartbeat:

    event: heartbeat
    data:

* this can happen when you suspend your laptop, on flaky internet conection, ADSL reconnect,
bad wifi signals, bad routers etc. Pretty often in a typical internet usage nowdays.