Refactor to add an interface for view_state of #mrheader

The goal of this refactoring is to make it easier to understand
and maintain view_state data structure of #mrheader.

Unlike record #mrview in #mrst, the data structure that represents
view_states in #mrheader is a tuple (of tuples) and its definition
and application spreads across all couch_mrview_util.erl module.
This makes it hard to follow and understand how it used
or troubleshoot mrview in case of the problems.

This change introduces an interface for generation and accessing
view_state and also separates generation of reduction closures
from mrview's `reduce`, `reduce_to_count` and `fold_reduce` functions
as they rely on view_state's structure.

Note that this refactoring also  removes explicit set of generic
ordering function on collation option "raw" as it is a default
of couch_btree:open on missing option for `less` function.
1 file changed
tree: fa52df107b16ac954c3dddb1cb11c4bb935acb1b
  1. include/
  2. priv/
  3. src/
  4. test/
  5. .travis.yml
  6. LICENSE