Improving template engine's compatibility

Removes any IE8 errors and ensures more DOM structure compatibility. The QUnit tests will still fail in IE8 though, avoiding to overload the test with browser specific code not related to the browser's current major version.

Change-Id: I77ce91f28c62f6e216bf7f48179b917502b06126