Move browser js to its own file
Add websocket token authentication
Extract connection to its own file and add tests