Precache chars in texteditor and tidy up a bit