Fix tests

This fixes a bunch of tests (not all of them yet though). Each commit fixes a separate thing, but I haven't submitted them separately as it was easier to work on a single branch when I was in the train (and it will be easier to see the difference in the test results.
actually, the DOM spec determines that the tagName is uppercase, and this is consistent across browsers AFAIK.