Added socket authorise and load user info

Use cookie to authorise user, load userid and get username. Show
username on receive message and on login/logout. Added logout. Issues:
[1] io.set(‘authorization’) not working as expected, can not return
value in handshake parameter. Used local variable temphack as a
workaround. [2] io.sockets.$emit not found, not critical leave as it
is. Will have impact if user opens several tabs.