Refactor the worker to have a Server abstraction

This PR add a `Server` object for the worker in a dedicated file in `static/js/worker/server.js`.

Trello card: https://trello.com/c/hmBsFUOd

**WIP: DO NOT MERGE ಠ_ಠ**