Refactored code to eliminate template parameters named TerminalSymbol

Now TerminalSymbol is a typedef in slp_vertex.h. Looks like there are no benefits from using multiple types.