Prettier text exporter

Please review and don't merge. I'll fix my git setup and propose/push this to LP after I arrive in Taiwan.