Fix redeclarations of variables
Fix variable shadowing
Remove duplicated `cmpPlayer`
Move querying of the same components out of loop
Change `if (foo > 0) ` to `if (foo)`
Change `if (foo == 0)` to `if(!foo)`
Fix remaining `var -> let`
Remove white space from empty object `{ }` to `{}`
Restyle more complicated objects.