tree proposal for issue 39

I don't like the solution that Jan is pushing.

Here are my reasons:
* it complicates a lot the code
* it uses a lot of memory
* it limits the count of labels (okay that's not a real issue, but... well theorical)

Then here is an alternate implementation. Fell free to comment.