Phrase I: split main.py to main.py and textline_proc.py