Remove derivation_count and add derivation_direction. Add tests for tries.