Use sorted instead of Counter for 2.6 compatibility.
Remove import for Counter in test suite.