implement chat logging
basic logging for groupchats
properly close windows on exit
log events