Fixed some code behind nastyness

Got rid of the code behind for most of the text editor, to handle
intellisense.

some improvements to intellisense.