Basic game loop and debugging tweaks.

Implemented a game loop, an fps counter, and tweaked the UI.
Compatibility + Console debugging enhancement.

Started putting in framework for code testing via console, added
polyfills, adjusted code structure.