Updated number of unread messaged and add new contact button

Updated number of unread messaged and now only show add new contact if
no name is found for the number
Moved socket init to sockethandler, new thread is better
Implemented a closing procedure
Fixed bug in getMessages