Fix saving issues: optimize cleanupText and rename it into cleanupDocument #57
Rm dbg msg