Add features of log and error recovery. Untested and still working
Close #9
Merge branch 'enhancement-#9' into develop