using matthewp/text where necessary for IE8, handling document fragments differently in some places for IE8, adjusting tests for IE8 as well