CommentParser: make line detection functions class methods