CoW tree: Make it self balancing

The tree should be self balancing, to ensure the worst case depth of
O(log(n)), which will occur if data is entered in a sequence.

We can ensure this by having a test that depth of 1000 objects is less
than or equal to 10. (10 comparisons when fetching at most)

There are still some overhead in this implementaiton, by creating some
intermediate nodes in when doing a left-right or right-left rotation
according to the AVL definition. We should be able to reuse those nodes
actually.

Signed-off-by: Max Sikstrom <msikstrom@op5.com>