Split out query options.
Implemented mapReduce