Improvements in line commenting. Some code cleanup in textbuffer