Replaced collections.Counter for python 2.6 compatibility

http://code.activestate.com/recipes/576611-counter-class/