Added export option. Export messages in JSON format.