Lot of changes. Using flipswitch. Reduce code size. Issue: duplicated server socket.emit.