Improve performance by reducing DOM modifications to 1. Fixes issue #3

Performance has increased by ~300%. Results:
http://jsperf.com/layoutengine-0-8-vs-0-7