Restructure format, and fix bugs
Fix sexpr_text_length function to handle quotation in string