replace treemap with a balanced tree

This is a full replacement for TreeMap as a balanced tree ([AA Tree](https://en.wikipedia.org/wiki/AA_tree)). I started from scratch so there aren't many similarities with the old implementation.

Improvements over the old implementation:

* neither the key or value type needs to implement `Copy` or `Clone` (only uses moves) and there's no usage of `@`
* insert, find and remove are O(log n) in the worst case instead of O(n) (the old TreeMap didn't actually have remove)
* O(n) implementation of `Eq`
* `TreeSet` wrapper, which will include O(n + m) implementations of `is_disjoint`, `is_subset`, `is_superset`, `difference`, `symmetric_difference`, `intersection` and `union`

In the future someone might want to replace this with a full red-black tree, but I think the performance will be pretty competitive as-is (and the asymptotic complexity would be the same). The constant factor for insertion is likely higher than a full rbtree implementation, but searching will be a bit quicker since the tree will usually be a bit more balanced.

Closes #2010, #2808.