Use Counter to determine most common line ending
Switch to defaultdict to support Python 2.6