Fix incorrect formatting of H1 elements

I had to refactor the tests a bit to make the new tests run correctly in Firefox and Chrome.