Move text related code to text.go.