[WIP] Add avl tests

This pull request adds and fixes the avl tests
Ah yes, in a hurry to get it working with the new api (since avl_insert now returns an int) I forgot to remove elements and the free.