Fixup support for `elementFormDefault`

While porting over the test cases from #332, I found a problem with the way I initially implemented `elementFormDefault`. I fixed that up and ported all the test cases.

This also includes another commit that fixes an issue with determining the namespace of complex child elements, that somehow only popped up with the correct `elementFormDefault` behavior.