Back port some of the newer OO History code here - doc read/write_history.