Use feature detection and more robust recovering of whitespace for innerHTML in IE8