Break out query_result => v8 array conversion to avoid duplicated code.