Reworked the attribute serialization code, reduced assertions in tests to the minimum (255 -> 103) by keeping track of my own results rather than relying on assertions. Still have tests failing in IE7-8, will work on those soon.