Update counter.py with defaultdict

Compatible (and preferred) with Python 2.5+.
Merge pull request #13 from kernc/patch-1

Update counter.py with defaultdict