Implement basic logging.
Fix wrong assignment of logging filters.
Add pep8 testing for tests/.
Make tests pep8-compliant.
Add setting log levels for console and file.

The log level for console is controlled by commandline switches (-v, -q
and --debug).

The log leve for the logfile and the path of the logfile is controlled
in the new [logging] section of the configuration file. Until the config
is read, logfile logging will be done into a MemoryHandler which will be
flushed to the logfile as soon as it is set up.

A little entangled change: The program will now exit gracefully after a
sys.exit() and a keyboard interrupt.
Add logging output, make existing one prettier.
Merge branch 'logging' into develop