Making it work with latest cowboy

Also added xref and removed dead code path for join_game.