Added back pointers, leaf counter above root node, update tester to catch errors.