Added export of all historical data to files. Painful.