Fix for IE8

IE8 doesn't have .textContent (nor even .innerText) for text nodes, so we should determine correct property name before using it.