Read and write chat history in a file. Sanitize and limit incoming data.