RUBY-596 Map reduce (WIP)