Moved Log (which writes to a log file log.txt) to a module
Further refactoring and clearing up code / tests for legibility