Features/treebuilder test

* missing TreeBuilder test
* Repository_read().data should be binary data (ifdef/else is a bit ugly but I found no other way)