Move utilities and records from couch_mrview and couch_index to couch_views

 * `couch_mrview_util` functions ended up mostly in `couch_views_util`.

 * `couch_mrview` validatation functions ended up in `couch_views_validate`
   module.

 * `couch_mrview_http` functions moved to `couch_views_http_util`. The reason
   they didn't end up in `couch_views_http` is because a lot of the functions
   there have the exact same names as the ones in `couch_views_http_util`.
   There is quite a bit of duplication involved but that is left for another
   refactoring in the future. The general flow of control goes from chttpd ->
   couch_views_http -> couch_views_http_util.

Most of the changes are just copy and paste with the exception of the
`ddoc_to_mrst/2` function. Previously, there were two almost identical copies
-- one in `couch_mrview_util` and another in `couch_views_util`. Both were used
by different parts of the code. The difference was the couch_views one
optionally disabled reduce functions, and replaced their body with the
`disabled` atom, while the one in `couch_mrview` didn't. Trying to unify them
such that only the `couch_views` one is used, resulted in the inability to
write design documents on server which have custom reduce disabled. That may be
a better behavior, however that should be updated in a separate PR and possibly
a mailing list discussion. So in order to preserve the exisiting behavior,
couch_eval was update to not fail in `try_compile` when design documents are
disabled.

Patches to the rest of the code to update the include path and use the new
utility functions will be updated in a separate commit.
5 files changed