Added a command line parameter for a log file, a function to log debug messages to that log file, and a --verbose option so that output can also be printed in stdout