Generic trees library.