Re-implement the chat logging system.

Also implement sending core events to remote clients.
Re-implement chat log fetching.