Fixed several bugs in WBXMLBuffer which were detected by new tests.
This includes at minimum the prevention of one segmentation fault.
Extended test framework and added tests for WBXMLBuffer.