Fixed issue with grouping keys when running locally

When running a job on the hadoop cluster unicode strings and str strings
are grouped to different reducers since we wrap repr() around the key.
This patch simulates that behaviour when running locally.