Performance fixes for preparing translation editor

Detach the editor while preparing it to boost performance

And some code cleanup

Change-Id: I9b4fafd772a43b1d6d8312d065efabccd674f14b
Merge "Performance fixes for preparing translation editor"