Refactoring backbone code to sync with server through websockets