wordcount: adapted from sritchie/cascalog-class