Refactored chat code and added chat service. Also added notes for chat and socket services.