Changes the stages variable to an object from an array
Consolidates the processEvent function

I also tried to get the stages draw function called with
requestAnimationFrame, but I created and infinite loop