Refactoring JS (graphics), correct connection to game, begin treat message