Port Main to Data.Text.