Clearing up cowboy websocket issues, refactoring the router