Slew of changes

Mostly optimizations and tests :)  Also includes an index.html file
that test the engine with DOM elements.