fixes #43, minimalized usage of global variable, total usage of user defined hash type in wordcount sample.