Adding a close window option for clients and cleaning up some code

Makes it possible for the clients to easily close the window after a chat
Merge branch 'cfdp.devel', remote-tracking branch 'origin/cfdp.devel' into cfdp.devel