Add ternary search tree implementation and tests