Updated map_reduce to new syntax, and using raw strings in the ERB file 
which generates the mapreduce Javascript code in order to avoid HTML 
encoding issues.
Updated Query existence check to new API syntax.
Merge pull request #3 from drusk/fixtests

Fixtests