mostCommonRowLength and findColumnHeadingIndex refactored

Code has been made much smaller