refactor of all websocket/network handler stuff (need to fix localhandler)