Text this: Optimizing tree decompositions in MSO