Add -log to log to a given file
Minor improvements to logging