ClassEvent mapper and reducer (for local running, may need some changes).