changed the badge on dock icon to number of unread chats rather than number of unread messages.
cleaning of framework structires.
changed the packing structure of the code.