Test for lazyness and gc behavior

This utilizes weakrefs to assert that an xml document can indeed be
parsed and traversed in a lazy composition, without retaining the head.