Introduce generic logging infrastructure

Start using the python logging module to handle output and log
messages. A single logger named 'time-slider' is used from the
main program and all modules.

All direct calls to sys.stderr.write are moved to .error
calls on the respective logger.

When running in foreground mode all log messages are sent to
stdout, when running in background mode all log messages are
sent to syslog.
Move util.debug and util.log_error to logging module
Use util.debug in config module
Set different message formats for stdout and syslog
Fix typo