Moved collision detection to separate file. Added functions through .prototype. Fixed broken variables.