incapsulate server in an anonymous function
move functions outside 'connection'
correct boolean choice
join a room by accessing from url
switch to Javascript Module Pattern