adding option to log directly to stdout
PEP8 style fixes, made some defaults more explicit
bugfix, 'changes' may not be defined