Simplify encoding
Simplify encoding

Instead of calling out to `couch_doc:from_binary/3` which does a lot,
just do what is necessary.

This also disentangles ns_server a bit more from the view-engine.

Change-Id: Ic2966baf502c8b05e2247d432162d78967483d50
Reviewed-on: http://review.couchbase.org/59085
Reviewed-by: Artem Stemkovski <15a0730a27c69f62ab86f2b6c639fca202166c02@couchbase.com>
Tested-by: Artem Stemkovski <15a0730a27c69f62ab86f2b6c639fca202166c02@couchbase.com>

ceejatec/ns_server,ceejatec/ns_server,membase/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,ceejatec/ns_server