Put global variable declarations on top of main.js.
Variables that should not be global are commented with TODOs.
Replaced old collision in player completed. UNSTABLE COMMIT!
There are errors, but I had to go again.