Improved history handling:
1. Made history read and write functions.
2. History size is (kinda) constant, new message pops off the oldest one.
3. History read and write is used by ECO_HISTORY so now it's better too,
   before it'd read first kHistoryKeptCount, now that is just a default for
   size of history and not a hard limit and the history reads last size
   lines.
Internal: Renamed kHistoryKeptCount to kDefaultHistorySize.
Old name didn't make sense anymore, since the purpose of this constant
changed in last commit that improved history handling a lot.