Fixed IE8 'function expected' bug

Fixed issue where Element is not a function in IE. Also fixed issue where requesting the root template resulted in a string missing an end </div>