Reworked code.

Refactored code, removed global variables, and created canvas, earth,
fire, and water objects.