Introduced activation/deactivation of debug through configuration, introduced centralized event logging and cleaned many log calls