Add an API call to the editor object to retrieve the LaTeX within the editor (eg. editor.getLatex())
Decouple the editor from TinyMCE, there isn't too much work here but some logic needs to be figured out to ensure the event handlers work properly (and things like the insert button need to be shown), maybe some sort of adapter object?
For example, within a question type.
A few thoughts here:
editor.getLatex()
)