Remove _sum and _count JS optimizer

The optimizations added in 6bfee7e3 and 8aff0d7d embed compiled
regular expressions to detect JS versions of built-in functions and
substitutes them for the faster Erlang call. The compiled expressions
do not work in all version of Erlang. Additionally, the error behavior
changes but the user will not know why.
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index 899de35..c84ff7e 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -33,39 +33,6 @@
 -define(STATERROR, <<"The _stats function requires that map values be numbers "
     "or arrays of numbers, not '~p'">>).
 
-% https://gist.github.com/df10284c76d85f988c3f
--define(SUMREGEX, {re_pattern,3,0,<<69,82,67,80,194,0,0,0,8,0,0,0,5,0,0,0,3,0,
-2,0,0,0,125,2,48,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,118,97,108,
-117,101,115,0,93,0,130,65,9,27,102,27,117,27,110,27,99,27,116,27,105,27,111,27,
-110,102,94,0,9,0,1,66,9,58,11,84,0,9,65,9,27,40,65,9,58,11,65,9,27,44,56,9,94,
-0,7,0,2,58,11,84,0,7,102,94,0,15,0,3,65,9,27,44,65,9,58,11,56,9,84,0,15,65,9,
-27,41,65,9,27,123,65,9,27,114,27,101,27,116,27,117,27,114,27,110,66,9,27,115,
-27,117,27,109,65,9,27,40,56,9,80,0,2,65,9,27,41,56,9,34,59,65,9,27,125,56,9,84,
-0,130,0,0,0,0>>}).
-
-% https://gist.github.com/cbd73238b671325f5a6f
--define(COUNTREGEX, {re_pattern,8,0,<<69,82,67,80,30,2,0,0,8,0,0,0,5,0,0,0,8,0,
-4,0,0,0,125,2,48,0,11,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,114,101,
-114,101,100,117,99,101,0,0,2,118,97,108,117,101,115,0,101,0,93,1,206,65,9,27,
-102,27,117,27,110,27,99,27,116,27,105,27,111,27,110,102,94,0,9,0,1,66,9,58,11,
-84,0,9,65,9,27,40,65,9,58,11,65,9,27,44,56,9,94,0,7,0,2,58,11,84,0,7,102,94,0,
-23,0,3,65,9,27,44,56,9,94,0,7,0,4,58,11,84,0,7,56,9,84,0,23,65,9,27,41,65,9,27,
-123,56,9,94,0,136,0,5,94,0,128,0,6,27,105,27,102,65,9,27,40,56,9,80,0,4,65,9,
-27,41,56,9,34,123,65,9,27,114,27,101,27,116,27,117,27,114,27,110,66,9,27,115,
-27,117,27,109,65,9,27,40,56,9,80,0,2,65,9,27,41,56,9,34,59,56,9,34,125,65,9,27,
-101,27,108,27,115,27,101,56,9,34,123,65,9,27,114,27,101,27,116,27,117,27,114,
-27,110,58,9,80,0,2,65,9,27,46,65,9,27,108,27,101,27,110,27,103,27,116,27,104,
-56,9,34,59,56,9,34,125,84,0,128,83,0,138,94,0,132,0,7,27,105,27,102,65,9,27,40,
-65,9,27,33,56,9,80,0,4,65,9,27,41,56,9,34,123,65,9,27,114,27,101,27,116,27,117,
-27,114,27,110,58,9,80,0,2,65,9,27,46,65,9,27,108,27,101,27,110,27,103,27,116,
-27,104,56,9,34,59,56,9,34,125,65,9,27,101,27,108,27,115,27,101,56,9,34,123,65,
-9,27,114,27,101,27,116,27,117,27,114,27,110,66,9,27,115,27,117,27,109,65,9,27,
-40,56,9,80,0,2,65,9,27,41,56,9,34,59,56,9,34,125,84,0,132,83,0,84,94,0,78,0,8,
-27,114,27,101,27,116,27,117,27,114,27,110,58,9,80,0,4,65,9,27,63,65,9,27,115,
-27,117,27,109,65,9,27,40,56,9,80,0,2,65,9,27,41,65,9,27,58,56,9,80,0,2,65,9,27,
-46,65,9,27,108,27,101,27,110,27,103,27,116,27,104,56,9,34,59,84,0,78,84,1,102,
-65,9,27,125,56,9,84,1,206,0,0,0,0,0,0,0>>}).
-
 
 try_compile(Proc, FunctionType, FunctionName, FunctionSource) ->
     try
@@ -146,13 +113,12 @@
             Result;
         (FunSrc, Values) ->
             os_rereduce(Lang, [FunSrc], Values)
-        end, replace_builtin_equivalents(RedSrcs), Grouped),
+        end, RedSrcs, Grouped),
     {ok, Results}.
 
 reduce(_Lang, [], _KVs) ->
     {ok, []};
-reduce(Lang, RedSrcs0, KVs) ->
-    RedSrcs = replace_builtin_equivalents(RedSrcs0),
+reduce(Lang, RedSrcs, KVs) ->
     {OsRedSrcs, BuiltinReds} = lists:partition(fun
         (<<"_", _/binary>>) -> false;
         (_OsFun) -> true
@@ -161,20 +127,6 @@
     {ok, BuiltinResults} = builtin_reduce(reduce, BuiltinReds, KVs, []),
     recombine_reduce_results(RedSrcs, OsResults, BuiltinResults, []).
 
-replace_builtin_equivalents([<<"_", _/binary>> = R | Rest]) ->
-    [R | replace_builtin_equivalents(Rest)];
-replace_builtin_equivalents([OsFun | Rest]) ->
-    case re:run(OsFun, ?SUMREGEX) of nomatch ->
-        case re:run(OsFun, ?COUNTREGEX) of nomatch ->
-            [OsFun | replace_builtin_equivalents(Rest)];
-        {match, _} ->
-            [<<"_count">> | replace_builtin_equivalents(Rest)]
-        end;
-    {match, _} ->
-        [<<"_sum">> | replace_builtin_equivalents(Rest)]
-    end;
-replace_builtin_equivalents([]) ->
-    [].
 
 recombine_reduce_results([], [], [], Acc) ->
     {ok, lists:reverse(Acc)};