added helper functions to read and write the RaftState into file to preserve state
Added test case for the read/Write of raftState to files