After some examination of the code, it seems like it would be easier to manipulate the official editor than make a standalone program. For example, the minified class Tx is basically the editor class and is constructed once at the beginning of a session.