fix server, always check if game exists; refactor jquery closures; clean global scope pollution
replace alerts with modal windows