Just a few hacks, integrating ideas from VivaJS
Refactoring
First shot at hardware-accelerated renderer