move the plaintext menu to the form

and a bit of code cleanup