Move word count functions into counts.py