Created a VirtualTextDocument baseclass to seperate some TextDocument logic.  Fixed Text-based object editing not saving keys when saved.