Move term, terminfo out of extra.

cc #8784