Mod avl interface

This PR will adapt the AVL interface to the layer structure laid out in issue #103.
Unresolved merge conflict here.

(Now I'm happy I reviewed this carefully)