Refactor the processing of the view group btree information

De-clutter the code a bit and move the processing of the btree
specific parsing into its own function.

Change-Id: Iaba910e94dd1b923dd7e4c8b5c4e981bd4d1ad93
Reviewed-on: http://review.couchbase.org/39628
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Make couchstore read the view type from couchdb

Couchstore deals with mapreduce as well as spatial views. In order to
know which view it currently processes, we need pass on the view type.

0 stands for mapreduce view
1 stands for spatial view

Change-Id: I7b19789d600d9497cf5314209fa37f12227ca469
Reviewed-on: http://review.couchbase.org/39629
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: Sarath Lakshman <sarath@couchbase.com>