Fix various JRuby failures

This is (for the time being) mostly related to tests being too strict. Nokogiri on JRuby is not the same as Nokogiri on normal Ruby, and that causes differences in output.

**Work in progress.**