[MAINT] Add unit tests for `Tree` data structure.

There are a few things left to do but let's merge as soon as Travis is happy. I am still not sure if it is worth keeping separating the data structure from DO-CV.