A reusable library for tree traversals where the 'visiting' operation is injected as an argument