Changed logging code to write to file when (1) chapter is opened, (2) next page is loaded, (3) chapter is finished, (4) back button in chapter is pressed, and (5) logout button is pressed.