Add TED implementation and tests