Cleaned up comparison code.
Element attributes are now compared independent from their order.