Make test order independent

This was tricky. Nokogiri's == operator checks identity, not equality. Need to convert nodes into strings and then compare strings.
Refactor test for readability