Add avl tests

This pull request adds and fixes the avl tests
Cannot be guaranteed, as `malloc()` does not fill the memory with zero here. Use `calloc`.