Clean up type parameters on Traverser and TraverserAux

I previously made these a bit more complicated than they need to be. I have now removed some unnecessary type parameters and changed the order of type parameters to prefer input types on the left and output types on the right.