Added some tests with treeDTIO.

Also a little restructuring.