Created functions for reading and writing a history log. Close #18
Updated comments and added test code.