Rewritten rendering engine

Completely rewrote the rendering to use requestAnimationFrame in order
to solve a responsiveness problem. The game runs 10x better now.