Make logging configurable

I want to send email on warnings from the actual instance
Update config
Fix _event_queue
Missing flush in update_build_state
Use before_commit instead of after_commit
Log publishing messages
Basic group editing